Storing 2*1 matrix in an array of size 25
2 views (last 30 days)
Show older comments
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
on 5 Jul 2017
What is j? What are "sets"? Do you mean "Eat * Fk" or the scalar "Eat(2,2)*Fk(2,1)"?
Accepted Answer
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)
See Also
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!