Effacer les filtres
Effacer les filtres

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

5 vues (au cours des 30 derniers jours)
Elias
Elias le 8 Fév 2024
Commenté : Elias le 9 Fév 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;

Réponse acceptée

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

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Graphics Object Programming dans Help Center et File Exchange

Tags

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by