Unable to perform assignment due to the different length of sides

2 ビュー (過去 30 日間)
sermet OGUTCU
sermet OGUTCU 2021 年 7 月 17 日
回答済み: Star Strider 2021 年 7 月 17 日
[FileName,pathname,d] = uigetfile('*.sp3','Choose the products','MultiSelect','on');
for i=1:2
full_file_name(:,i) = fullfile(pathname,FileName(:,i));
end
full_file_name=char(full_file_name);
for i=1:2
Str(i,:) = fileread(full_file_name(i,:));
end
Here, when the lenght of first and second Str is not equal, I receive "Unable to perform assignment because the size of the left side is 1-by-35930605 and the size of the right side is 1-by-35909334" error. How I can store multiple Str while the theirs lenght are different?

採用された回答

Star Strider
Star Strider 2021 年 7 月 17 日
A cell array could be appropriate here:
Str{i} = fileread(full_file_name(i,:));
.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by