MATLAB Answers

0

check inside cell condition

Asked by Venkat Ta on 7 Aug 2019
Latest activity Commented on by Venkat Ta on 8 Aug 2019
AppleDECB =
2×1 cell array
{'/Users/venkat/Desktop/ extract/Validation/V3 70/CURVES_initial'}
  • The AppleDECB cell made to receive directory if the directory has any files inside.
  • suppose no files, AppleDECB ={0};
  • Now I have to make condition if AppleDECB 0 no process, else I have to use the directory path to process.
  • How can i make if else condition or another way?Screen Shot 2019-08-08 at 1.32.20 AM.png

  0 Comments

Sign in to comment.

Tags

Products


Release

R2018a

1 Answer

Answer by SHUBHAM GUPTA on 8 Aug 2019
 Accepted Answer

Try this:
for i = 1:length(AppleDECB)
if ~ischar(AppleDECB{i}) % check if cell doesn't contain char
continue; % continue for loop without any process
end
% Write your process here
end
I hope it helps !

  1 Comment

Thanks
Nice idea

Sign in to comment.