Info

この質問は閉じられています。 編集または回答するには再度開いてください。

What is the function of the following if statement?

3 ビュー (過去 30 日間)
Rosie
Rosie 2017 年 2 月 3 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
if (iscell(data_folder))
data_folder = data_folder{1};
end

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 2 月 3 日
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.

この質問は閉じられています。

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by