필터 지우기
필터 지우기

Why Cell array is created in different way ?

조회 수: 1 (최근 30일)
Karthik KJ
Karthik KJ 2012년 6월 30일
Hi I am creating a cell array like this
SensorList.sensorname = ...
{ 'Wind speed (m/s)' 'Vhub'; % 1
'Electrical power (KW)' 'P'; % 2
}
If i run this in matlab, im getting
SensorList.sensorname
'Wind speed (m/s)' 'Vhub'
[1x21 char] 'P'
If i refer SensorList.sensorname{2,1}, i get Electrical power (KW). But why it is showing [1x21 char]. Im facing some difficulty in the next steps of my iteration, pls tell me the difference in the way cell array is created in column 1. How to create it in the same way as Wind speed.

채택된 답변

Jan
Jan 2012년 6월 30일
This concerns only the display in the command window, while the actual value is correct and as expected.
Th DISP command is called to show the contents of the cell in the command window. This command tries to give the output a tabular appearance and therefore it abbreviates long strings.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by