Storing 2*1 matrix in an array of size 25

2 views (last 30 days)
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 Comments
Jan
Jan on 5 Jul 2017
What is j? What are "sets"? Do you mean "Eat * Fk" or the scalar "Eat(2,2)*Fk(2,1)"?
Swagato Das
Swagato Das on 5 Jul 2017
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).

Sign in to comment.

Accepted Answer

KSSV
KSSV on 5 Jul 2017
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

More Answers (0)

Categories

Find more on Matrices and Arrays in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!