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.

采纳的回答

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