Create graph in 3 dimension
Ältere Kommentare anzeigen
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 Kommentar
Walter Roberson
am 6 Jul. 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) ?
Antworten (1)
Walter Roberson
am 6 Jul. 2015
plot3(x_n, y_n, z_n)
possibly, depending on what you want plotted.
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!