Dear All,
I defined a struct and initialize it in the following way.
Res_All_Meas = struct([]);
[Res_All_Meas(1000).ind] = 0;
[Res_All_Meas(1000).res] = 0;
[Res_All_Meas(1000).xline] = 0;
[Res_All_Meas(1000).colnum] = 0;
Now in an iteration, I want to check if Res_All_Meas(i) is empty or not. If it is empty, I will assign some valeus to it.
Thanks a lot.
Benson
3 Comments
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/613956-how-to-check-if-a-element-of-a-struct-is-empty#comment_1059651
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/613956-how-to-check-if-a-element-of-a-struct-is-empty#comment_1059651
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/613956-how-to-check-if-a-element-of-a-struct-is-empty#comment_1059716
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/613956-how-to-check-if-a-element-of-a-struct-is-empty#comment_1059716
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/613956-how-to-check-if-a-element-of-a-struct-is-empty#comment_1060358
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/613956-how-to-check-if-a-element-of-a-struct-is-empty#comment_1060358
Sign in to comment.