why is my cell array being read as char
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I am defining two 2 parameters the same way but they are recognized differently in my code
Reference_stations = {'NUF','BRA','RFL'};
Reference_station_salinity = {'SPO','NUF','BRA','RFL'};
disp(class(Reference_stations));
disp(class(Reference_station_salinity));
2 Kommentare
Antworten (1)
Image Analyst
am 4 Feb. 2025
Are you sure you're getting the class of the whole cell array instead of the class of one of the contents of one cell in the array?
Reference_stations = {'NUF','BRA','RFL'};
Reference_station_salinity = {'SPO','NUF','BRA','RFL'};
disp(class(Reference_stations));
disp(class(Reference_station_salinity));
% Get class of just one cell in the array.
disp(class(Reference_stations(1)));
disp(class(Reference_station_salinity(1)));
% Get class of just one cell's CONTENTS in the array.
disp(class(Reference_stations{1}));
disp(class(Reference_station_salinity{1}));
See the FAQ to know when to use parentheses, braces, or brackets:
0 Kommentare
Siehe auch
Kategorien
Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!