필터 지우기
필터 지우기

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

조회 수: 5 (최근 30일)
Elias
Elias 2024년 2월 8일
댓글: Elias 2024년 2월 9일
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