Delete rows from string array with just one value
조회 수: 7 (최근 30일)
이전 댓글 표시
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
채택된 답변
Arif Hoq
2022년 3월 24일
편집: Arif Hoq
2022년 3월 24일
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
Arif Hoq
2022년 3월 24일
~ supposed to mean not.
~= menas not equal.
isequal function returns empty cell. so ~ which is used before isempty fucntion returns not empty cell
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!