Effacer les filtres
Effacer les filtres

Why Cell array is created in different way ?

1 vue (au cours des 30 derniers jours)
Karthik KJ
Karthik KJ le 30 Juin 2012
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.

Réponse acceptée

Jan
Jan le 30 Juin 2012
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.

Plus de réponses (0)

Catégories

En savoir plus sur Data Types dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by