I would like find a matrix from a row and column vectors
Afficher commentaires plus anciens
Hello, I have a column vector xxb of 201 elements and a row vector rr of 501 elements and I would calculate c =xxb^2+rr^2-R^2 with R=0.05. I have to obtain a matrix of (501x201)size.But i found (501x501). Here is below my code. Anyone has a idea. Thank you in advance, Adam
xb=-5:0.05:5;
xxb=xb';% column vector
r=0:0.01:5;
rr=r;% Row vector
R= 0.05;
for l=1:length(xxb);
for m=1:length(rr);
a(l)=2.*xxb(l);
c(l,m)=xxb(l).^2+rr(m).^2+R^2;
end
end
Réponse acceptée
Plus de réponses (1)
adam
le 14 Août 2012
Catégories
En savoir plus sur Contour Plots dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!