Coder Structure element Size Mismatch error during subscripting
古いコメントを表示
Hi
I am facing Size mismatch error while performing array operation with structure .I need help in resolving the issue
Impnse.isOut(:,idx) = memfcn(1:size(Impnse.f(:,idx),1),locs);
Error Message : Size mismatch ([441000 x 1] ~= [:? x 441000])
f = zeros(441000, 2)
isOut = zeros(size(f,1),2);
Input Impnse = struct('f',f ,'isOut' ,isOut);
Impnse.isOut(:,idx) = memfcn(1:size(Impnse.f(:,idx),1),locs);
size(1:size(Impnse.f(:,idx),1))
ans =
1 441000
size(locs)
ans =
1423 1
size(Impnse.isOut(:,idx))
ans =
441000 1
Size mismatch ([441000 x 1] ~= [:? x 441000])
6 件のコメント
Adam Danz
2020 年 8 月 28 日
What is the size of the output?
x = memfcn(1:size(Impnse.f(:,idx),1),locs)
size(x)
Life is Wonderful
2020 年 8 月 28 日
Life is Wonderful
2020 年 8 月 28 日
編集済み: Life is Wonderful
2020 年 8 月 28 日
Adam Danz
2020 年 8 月 28 日
I'm guessing that you need,
Impnse.isOut(idx,:) = memfcn(1:size(Impnse.f(:,idx),1),locs);
% ^^^^^
Life is Wonderful
2020 年 8 月 28 日
Adam Danz
2020 年 8 月 28 日
Addressed below in my answer.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!