How to manipulate 2 matrices and form a third matrix
Show older comments
I have the following vectors:
a = [1 2]; b = [0.25 0.5];
i aim to get the following 2 x2 matrix
% c = [1/0.25+1/0.5 2/0.25+1/0.5
% 1/0.25+2/0.5 2/0.25+2/0.5]
does anyone have an idea how i would achieve this?
thanks
Answers (2)
Azzi Abdelmalek
on 17 Apr 2013
a = [1 2];
b = [0.25 0.5];
for k=1:2
for p=1:2
c(k,p)=a(k)/b(1)+a(p)/b(2)
end
end
Categories
Find more on Resizing and Reshaping Matrices 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!