Strings: delete rows with empty values
26 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Matthew Tyler Jeffries
am 25 Feb. 2019
Kommentiert: Stephen23
am 14 Jul. 2020
I have a very large string array (part of it is shown below), and sometimes the secound column contains "empty" values. I would like to delete each row whose second column is empty.
"laterite-00047" "" "zeros(0,1)"
"laterite-00048" "" "zeros(0,1)"
"laterite-00049" "204186,54901" "204186"
"laterite-00050" "204186,54901" "54901"
"laterite-00051" "" "zeros(0,1)"
"laterite-00052" "204186,54901" "54901"
2 Kommentare
Stephen23
am 14 Jul. 2020
For a string array the correct method to way to cound the number of characters is to use strlength:
Akzeptierte Antwort
madhan ravi
am 25 Feb. 2019
a(~any(cellfun('isempty',a),2),:) % where a is your string array
2 Kommentare
Aishwarya Venkatesh
am 14 Jul. 2020
if i want to remove columns containing all empty values in the string. Then how this can be modified?
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Characters and Strings 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!