conversion from cell to char is not possible

13 ビュー (過去 30 日間)
new_user
new_user 2021 年 12 月 28 日
コメント済み: new_user 2021 年 12 月 28 日
I was getting an error message that conversion from cell to char is not possible. I showed in the next few lines how i stored the training images, also I crreated a imagedatastore for storing the images from folder for training and validation while the test images are in different folder.

採用された回答

Voss
Voss 2021 年 12 月 28 日
It looks like Training_Image.Files is a cell array of chars, and you are attempting to take one of those chars and assign it to be a cell in a cell array (as opposed to assign it to be the contents of a cell in a cell array). You can do what I think you want to do in a couple of different ways:
files(h) = Training_Image.Files(n(h));
or
files{h} = Training_Image.Files{n(h)};
But then you're going to run into an error when h = 16 because n only has 15 elements.
  1 件のコメント
new_user
new_user 2021 年 12 月 28 日
it's working now, Thanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by