How to check whether a specific variable is empty or not in table type
16 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sangmin Lee
am 17 Apr. 2020
Kommentiert: Sangmin Lee
am 17 Apr. 2020
Hi, please see the follwing figure.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/285239/image.jpeg)
As you can see, in this 'table' type variable, some rows does not have 'ls_max_tone' and some have 'ls_max_tone' .
'ls_max_tone' variable is defined as 'cell' type.
I can find which row has 'ls_max_tone' variable using for loop. However, I know this is not efficient way.
Is there any efficient way such as
T_data(T_data.temperature >50, :)
which returns all rows that temperature value exceeds 50.
Thanks in advance.
0 Kommentare
Akzeptierte Antwort
Tommy
am 17 Apr. 2020
T_data(~cellfun(@isempty, T.ls_max_tone),:)
This will return a table containing only the rows where ls_max_tone is not empty.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical 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!