matlab - Meshgrid stretching surface plot -
i have been trying add axis surf plot have. i've tried various suggestions can't work. have 3 matrices:
final -> 3460x300 double
spec -> 1x300 double (x-axis)
timedate -> 1x3460 double (y-axis)
the timedate matrix values converted time , dates date2num.
i tried
plot = surf(final); set(plot,'linestyle','none'); which gives me correct graph axis wrong. see image: 
when try
[xx,yy] = meshgrid(spec,timedate) plot2 = surf(xx,yy,final); set(plot,'linestyle','none'); it gives me correct axis graph seems stretched 
how solve this?
thanks in advance
the second graph seems correct, first 1 assumes fixed distance between samples , second 1 uses complete info (x, y , z axis), below simplification of problem:
let's want graph curve described points (0.5, 1), (1, 2), (1.5, 3), (2, 4), correct way of doing is:
x = [0.5, 1, 1.5, 2]; y = [1, 2, 3, 4]; plot(x, y) but doing:
plot(y) both graphs show same curve (because points sampled fixed distance in x axis) points scaled , displaced along x axis.
but, if points (0.5, 1), (1.2, 2), (1.4, 3), (2.2, 4)?:
plot(x,y) , plot(y) show different curves because points not sampled fixed distance along x axis, that's happens in problem.
Comments
Post a Comment