Looking for empty spaces in input array from excel
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Saeid
am 16 Jan. 2018
Beantwortet: Harish Ramachandran
am 2 Feb. 2018
I read data from an excel file with both text and numerical data, and I would like to detect the empty spaces between the rows. When I perform the command:
[NUMM,STRR,RAWW]=xlsread(InputFile,1);
indx=cellfun(@isnan,RAWW(:,1),'uni',false)
I get another cell array that looks like:
[1×14 logical]
[1×10 logical]
[1×10 logical]
[1×20 logical]
[1×9 logical]
[ 1]
[ 1]
[1×43 logical]
[1×16 logical]
[1×10 logical]
[1×20 logical]
[1×10 logical]
But I cannot find the location of the "1" in this array. I tried e.g. cell2mat but it doesn't covert the arrays into numerical ones. How can I solve this problem?
0 Kommentare
Akzeptierte Antwort
Harish Ramachandran
am 2 Feb. 2018
You can use the find command:
c = {[5 5 5],1,1,1,1,1,1}
indx = find([c{:}] == 1)
c =
1×7 cell array
{1×3 double} {[1]} {[1]} {[1]} {[1]} {[1]} {[1]}
index =
4 5 6 7 8 9
Reference:
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Cell Arrays 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!