Storing 2*1 matrix in an array of size 25
11 ビュー (過去 30 日間)
古いコメントを表示
I have got the following set of values:
Fmd-single value
Ac-single value
Eat-2*2 matrix
Fk-2*1 matrix
Fk=[0;1]*(Fmd+ac(j,1))
Has=Eat*Fk.
The dimension of Has is 2*1. I would like to store the value for 25 sets.
I have used the
Has(2,j)=Eat(2,2)*Fk(2,1)
The error is 'assignment has more non-singleton rhs dimensions than non singleton subscripts.
Please help.
2 件のコメント
Jan
2017 年 7 月 5 日
What is j? What are "sets"? Do you mean "Eat * Fk" or the scalar "Eat(2,2)*Fk(2,1)"?
採用された回答
KSSV
2017 年 7 月 5 日
Fmd = rand ; %-single value
Ac = rand ; % -single value
Eat = rand(2) ; % -2*2 matrix
Fk = rand(2,1) ; % -2*1 matrix
ac = rand(25,1) ;
Has = zeros(2,25) ;
for j = 1:25
Fk = [0;1]*(Fmd+ac(j,1)) ;
Has(:,j)=Eat*Fk ;
end
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Matrices and Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!