Delete rows from string array with just one value
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Tatjana Mü
am 24 Mär. 2022
Bearbeitet: Henry Barth
am 25 Mär. 2022
Hi,
I have a string array like this:
x=[Na,Mg,Si ; V ; Na,Mg,Si,S ; Si ; Na,Mg,Al,P]
I want to delete all the rows which contain just one Value. Does somebody has an idea how it could work? Because I reached my limit of knowledge (really new in matlab).
I appreciate any idea :-)
2 Kommentare
Akzeptierte Antwort
Arif Hoq
am 24 Mär. 2022
Bearbeitet: Arif Hoq
am 24 Mär. 2022
as i don't have your data so i have added NaN string to make the same dimension cell array
x={'Na','Mg','Si' NaN; 'V' NaN NaN NaN; 'Na','Mg','Si','S' ; 'Si' NaN NaN NaN; 'Na','Mg','Al','P'};
a=string(x);
y=rmmissing(a,1,'MinNumMissing',2);
output=cellstr(y)
8 Kommentare
Arif Hoq
am 24 Mär. 2022
~ supposed to mean not.
~= menas not equal.
isequal function returns empty cell. so ~ which is used before isempty fucntion returns not empty cell
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!