Borrar filtros
Borrar filtros

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

5 visualizaciones (últimos 30 días)
Elias
Elias el 8 de Feb. de 2024
Comentada: Elias el 9 de Feb. de 2024
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;

Respuesta aceptada

Walter Roberson
Walter Roberson el 8 de Feb. de 2024
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 comentario
Elias
Elias el 9 de Feb. de 2024
Okay thank you so much, I will try to use the warp function instead that seems like it would be much easier.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Graphics Object Programming en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by