Create graph in 3 dimension

I have create an iteration as following:
format long
A=[1 0 2; -1 3 4; 2 1 0]
x_n=[-2 4 -3]'
for n=1:50
b_n(:,n)=A*x_n(:,n);
prox1(:,n)=1/3*((b_n(:,n))+[8 10 -8]');
y_n(:,n)=b_n(:,n)-prox1(:,n);
z_n(:,n)=A'*y_n(:,n);
h(n)=1/2*(norm(y_n(:,n)))^2;
gradh(n)=(norm(z_n(:,n)))^2;
u(n)=2*h(n)/gradh(n);
r_n(:,n)=x_n(:,n)-u(n)*z_n(:,n);
prox2(:,n)=1/3*(r_n(:,n)+[-2 -4 5]');
x_n(:,n+1)=((1/(1000*(n+1)))*[1 1 1]')+((1-(1/(1000*(n+1))))*prox2(:,n))
end
Now, I would like to plot all the values as points in the same three dimensional coordinate. If possible, how should I do?
Thank you so much in advance.

1 commentaire

Walter Roberson
Walter Roberson le 6 Juil 2015
Please be specific about which values are to be which axis. Are you looking for a series of 3D lines, x_n(:,n) vs y_n(:,n) vs z_n(:,n) ?

Connectez-vous pour commenter.

Réponses (1)

Walter Roberson
Walter Roberson le 6 Juil 2015

0 votes

plot3(x_n, y_n, z_n)
possibly, depending on what you want plotted.

Catégories

En savoir plus sur 2-D and 3-D Plots dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by