i want to plot a 3d graph using surf in matlab. i know how to plot it just using surf:
k = 5;
n = 2^k-1;
[x,y,z] = sphere(n);
c = hadamard(2^k);
p=surf(x,y,z);
but i want to plot this in realtime, and i want to update the values using set.
I tired:set(p,"XData",Xvalue,"YData",Yvalue,"ZData",Zvalue); but its giving me errors. has anyone plotted using surf in realtime?
1) you can use the linkdata command or toolbar button (or even Tools -> Link from the plot window)
2) programmatically: you need to call the command ‘refreshdata’ to signal that new data is available:
This shows it for the
plot, but expectsurfwill behave the same.