Why Cell array is created in different way ?
조회 수: 1 (최근 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.
댓글 수: 0
채택된 답변
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
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!