how i do a 3D plot of rect(n1,n2) function

조회 수: 7 (최근 30일)
john m
john m 2021년 3월 14일
댓글: Star Strider 2021년 3월 15일
how i do a 3D plot of rect(n1,n2) function
  댓글 수: 1
Star Strider
Star Strider 2021년 3월 15일
Please provide the documentatiion link to that function. (It is not present in the online documentation, and I cannot find it in an Interweb search.)

댓글을 달려면 로그인하십시오.

답변 (1개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2021년 3월 14일
편집: KALYAN ACHARJYA 2021년 3월 14일
n1=-1;
n2=1;
[x,y]=meshgrid(n1:0.01:n2,n1:0.01:n2);
z=zeros(size(x,1),size(x,2));
z(x>-0.5 & x<0.5)=1;
s=surf(x,y,z,'FaceAlpha',0.5);
s.EdgeColor = 'b';
  댓글 수: 1
john m
john m 2021년 3월 15일
Is this the only way to plot a rectangular? Because i think there is (rect) function but you didn’t use it

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by