What is the function of the following if statement?
Info
This question is closed. Reopen it to edit or answer.
Show older comments
if (iscell(data_folder))
data_folder = data_folder{1};
end
Answers (1)
Walter Roberson
on 3 Feb 2017
2 votes
In some flow of code it expects that data_folder might have become a cell array, and when it detects that, it extracts the first element of the array.
For example you might use that code if you want the user to be able to pass either a string or a cell array containing a string.
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!