i want a good syntax form
1 回表示 (過去 30 日間)
古いコメントを表示
s is matrix that has 6 rows and Qbar is an array that contains n number of matrices matrices
s(1,:)*Qbar{1}
s(2,:)*Qbar{1}
s(3,:)*Qbar{2}
s(4,:)*Qbar{2}
s(5,:)*Qbar{3}
s(6,:)*Qbar{3}
this is how i want it to be
is there any syntax i can make this happen?
0 件のコメント
回答 (2 件)
KALYAN ACHARJYA
2022 年 5 月 16 日
Using loop: Is that OK?
data_cell=cell(..,..) %Preallocate Memory
iter=1:3:size(s,1);
for i=1:3:6
data_cell{i}=s(i,:)*Qbar{i}
data_cell{i+1}=s(i+1,:)*Qbar{i}
end
6 件のコメント
KALYAN ACHARJYA
2022 年 5 月 16 日
array of matrices can be store as Cell array, it can be extarted using { } bracket
mat{1} represents the first matrics with the cell array.
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!