From: Zhu Zhang on
Hi there,
I got a problem on rotate(), I here make a surface(hsp), then try to rotate that for a certain angle before plot by slice(). However I figured that I could not rotate more than 45 degree in this case. I can make another surface vertical to x-axis, then rotate. Could anyone help me why I could not do it? Thx.

[x,y,z] = meshgrid(-2:.2:2,-2:.25:2,-2:.16:2);
v = x.*exp(-x.^2-y.^2-z.^2);
xslice = 1.2; yslice = []; zslice = [];
hsp = surf(linspace(-2,2,21),linspace(-2,2,21),zeros(21));
% center=[0 2 -2];
rotate(hsp,[-1,0,0],-45);
xd = get(hsp,'XData');
yd = get(hsp,'YData');
zd = get(hsp,'ZData');
delete(hsp)
slice(x,y,z,v,xd,yd,zd);hold on
colormap hsv
From: nanren888 on
"Zhu Zhang" <zhangjiamingbu(a)gmail.com> wrote in message <hm8tmo$t25$1(a)fred.mathworks.com>...
> Hi there,
> I got a problem on rotate(), I here make a surface(hsp), then try to rotate that for a certain angle before plot by slice(). However I figured that I could not rotate more than 45 degree in this case. I can make another surface vertical to x-axis, then rotate. Could anyone help me why I could not do it? Thx.
>
> [x,y,z] = meshgrid(-2:.2:2,-2:.25:2,-2:.16:2);
> v = x.*exp(-x.^2-y.^2-z.^2);
> xslice = 1.2; yslice = []; zslice = [];
> hsp = surf(linspace(-2,2,21),linspace(-2,2,21),zeros(21));
> % center=[0 2 -2];
> rotate(hsp,[-1,0,0],-45);
> xd = get(hsp,'XData');
> yd = get(hsp,'YData');
> zd = get(hsp,'ZData');
> delete(hsp)
> slice(x,y,z,v,xd,yd,zd);hold on
> colormap hsv

I see noone else seems to have answered.
What exactly is the problem?
I had not noticed rotate & slice, as I had always programmed rotations myself.
Your code seems to run for any angle I give it.
Sorry to be thick.
Can you explain the issue?
 | 
Pages: 1
Prev: Data Fusion with Kalman Filter
Next: MuPAD Error??