Imagesc plot along x-z axis instead of x-y
3 次查看(过去 30 天)
显示 更早的评论
I've been plotting two interfering 3D plane waves in matlab and am being asked to make a plot of the irradiance of these functions. At first I was asked to make a plot of the irradiance in the x-y axis, which I did using imagesc() of the real part of the function. Now I am being asked to take this same function and make a plot of the irradiance in the x-z axis specifically at the point y=0, which I am unsure of how to do based on the nature of the imagesc function. If someone could please help me better understand the way I can do this that would be greatly appreciated!
for reference here are the versions of my functions I have been using are these:
i=sqrt(-1)
x=linspace(0,3.*0.75,100);
y=linspace(0,3.*0.75,100);
[X Y]=meshgrid(x,y);
U1=exp(i.*(((4.*sqrt(2).*pi)./3).*X+(4.*sqrt(2).*pi)./3).*Y-(2.*pi./3));
U2=exp(i.*(((4.*sqrt(2).*pi)./3).*X-(4.*sqrt(2).*pi)./3).*Y-(2.*pi./3));
Ut=U1+U2;
0 个评论
采纳的回答
Walter Roberson
2024-2-8
It is possible to imagesc() in the x-z axis.
What you need to do is create an hgtransform object that is parented to the axis, and parent the imagesc() to the hgtransform object, and set the Matrix property of the hgtransform object. It helps to use makehgtform to create the matrix.
However, you run into the problem that image objects are considered to be infinitely thin, so if you view from off-axis then they nearly disappear.
A more robust approach is to not use image() or imagesc(), and to instead use warp to construct the image.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Performance 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!