How to see cell array content without having to click on the cell?

3 vues (au cours des 30 derniers jours)
Atiqah Zakirah
Atiqah Zakirah le 9 Juin 2017
Modifié(e) : Stephen23 le 9 Juin 2017
I have a cell array and I want all the values to be displayed without having to click on the cell. The cell only holds one value, so it should be possible right? It should display the value rather than "1x1 cell". This is the code I have. Must I include something or make any changes so my data displays the way I want it to?
for j = 1:length(inCircle)
inCirclestns{j,1} = coordinates(inCircle(j));
end
% find station number and convert to station name
for k = 1:length(inCircle)
if [inCirclestns{k,1}] <= 191
[inCirclestns{k,1}] = stations(find([stations{:,3}] == coordinates(inCircle(k,1))),6); % convert to string
else
[inCirclestns{k,1}] = [inCirclestns{k,1}]; % no change
end
end
  1 commentaire
Stephen23
Stephen23 le 9 Juin 2017
Modifié(e) : Stephen23 le 9 Juin 2017
"The cell only holds one value, so it should be possible right?"
Nope. The cell holds another cell array, so MATLAB correctly displays that.
The solution, as Walter Roberson shows, is to actually put a numeric value in each cell, and not another cell array.

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 9 Juin 2017
[inCirclestns{k,1}] = stations{find([stations{:,3}] == coordinates(inCircle(k,1))),6}; % convert to string

Plus de réponses (0)

Catégories

En savoir plus sur Data Type Conversion 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