Imagesc plot along x-z axis instead of x-y

5 次查看(过去 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;

采纳的回答

Walter Roberson
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.
  1 个评论
Elias
Elias 2024-2-9
Okay thank you so much, I will try to use the warp function instead that seems like it would be much easier.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graphics Object Programming 的更多信息

标签

产品


版本

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by