hi everyone , i need help to make this , thank u
Show older comments
i hava two matrix 2x8
A=2*ones(2,8)
B=3*ones(2,8)
what i need is to access on
1) on each column of matrix A so i need to get out a column vector 2x1 for 8 times to use it in a certain iteration
2) and then on each column of matrix B the same
all of this in the same iteration inside a loop
because if the two matrix are 1x8 it will be easy with two for i=1:8 and j=1:8 (in this case he gave me (1,1) and (1,2) ............ 1,8) then (2,1) ,(2,2) ................. (2,8)) but in this case i need to extract not an element but a column vector.
thank you
9 Comments
madhan ravi
on 7 Apr 2019
Edited: madhan ravi
on 7 Apr 2019
in this case he gave me
who??, homework
mina massoud
on 7 Apr 2019
madhan ravi
on 7 Apr 2019
Edited: madhan ravi
on 7 Apr 2019
2*ones(2,1,8)
mina massoud
on 7 Apr 2019
madhan ravi
on 7 Apr 2019
Edited: madhan ravi
on 7 Apr 2019
Do the same thing.
mina massoud
on 7 Apr 2019
madhan ravi
on 7 Apr 2019
What do you mean ?, illustrate with an example
Image Analyst
on 7 Apr 2019
Edited: Image Analyst
on 7 Apr 2019
Example would be good. Plus explain what "access on" means. Do you simple mean
[rows, columns] = size(A);
for col = 1 : columns
thisColA = A(:, col) % Extract column from A.
thisColB = B(:, col) % Extract column from B.
% Now do something .....
end
mina massoud
on 7 Apr 2019
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing 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!