not compatible with the size
1 回表示 (過去 30 日間)
古いコメントを表示
SANDIPKUMAR ROYADHIKARI
2021 年 12 月 11 日
コメント済み: Walter Roberson
2021 年 12 月 12 日
itr=0; % number of iteration
for t=1:1:3
itr=itr+1;
b(itr)=[sin(t) cos(t)];
end
In the above code , I am getting the error " Unable to perform assignment because the indices on the left side are not compatible with the size of the right side."
Please tell me how to fix.
0 件のコメント
採用された回答
Chunru
2021 年 12 月 11 日
itr=0; % number of iteration
for t=1:1:3
itr=itr+1;
b(itr, :)=[sin(t) cos(t)]; % Two numbers for each iteration form a row for a matrix b (nitr x 2)
end
b
4 件のコメント
Chunru
2021 年 12 月 12 日
itr=0; % number of iteration
for t=1:1:3
itr=itr+1;
b(itr, :)=[sin(t) cos(t)];
c(itr, :)=[1-sin(t) 1];
end
d=[b c]
Walter Roberson
2021 年 12 月 12 日
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Shifting and Sorting Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!