Converting Cell Arrays to Strings
Ältere Kommentare anzeigen
I am trying to convert a cell array to string. Got stuck in this.
[num_data,headers]=xlsread(Excel_file_name,Worksheet_name,range_select);
len_headers=max(size(headers));
for var=1:len_headers
var
dummy=headers(var)
eval(strcat(dummy,'=genvarname(headers{var});'));
eval(strcat(dummy,' = num_data(:,var);'));
end
Variable definitions:
But this is giving an error as eval() accepts only strings. dummy remains a 1x1 cell array and after using strcat, the final output of strcat also remains a cell array.
The problem is of converting a cell array to a pure string.
Akzeptierte Antwort
Weitere Antworten (1)
Kategorien
Mehr zu Characters and Strings finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!