How to load a cell array which contains both strings and numbers to matlab?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Supreet Hegde
am 30 Jul. 2015
Kommentiert: Supreet Hegde
am 30 Jul. 2015
I have a cell array that has both strings and numbers. I want to load all the elements of the cell array. For the same I used the following method:
load(filename);
This command is loading only strings and excluding the columns that has numbers. Basically since my file is not .mat extension, it is treating it as ASCII file and loading only text.
I tried "importdata(filename)" to import the file directly from excel. But that gives me struct of 1*1 with text and numbers separated. I need the elements to be imported into another cell array of same dimension.
Is there a way to load all the values?
0 Kommentare
Akzeptierte Antwort
Azzi Abdelmalek
am 30 Jul. 2015
For Excel file use xlsread function
[num,text,both]=xlsread('FileName')
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Spreadsheets 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!