Storing 2*1 matrix in an array of size 25

11 ビュー (過去 30 日間)
Swagato Das
Swagato Das 2017 年 7 月 4 日
コメント済み: Swagato Das 2017 年 7 月 5 日
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
Jan 2017 年 7 月 5 日
What is j? What are "sets"? Do you mean "Eat * Fk" or the scalar "Eat(2,2)*Fk(2,1)"?
Swagato Das
Swagato Das 2017 年 7 月 5 日
J is the range of array=25. There are 25 sets of data to be stored in the array of size 2*25. I meant Eat(2,2)*Fk(2,1).

サインインしてコメントする。

採用された回答

KSSV
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
  1 件のコメント
Swagato Das
Swagato Das 2017 年 7 月 5 日
Thank you...

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by