필터 지우기
필터 지우기

How do I fix this formula to plot a 3D surface plot?

조회 수: 1 (최근 30일)
Jason
Jason 2014년 11월 4일
댓글: Star Strider 2014년 11월 4일
I've already tried different with and with out .* operator for the numerator and it still will not plot. The error I get is this...
Warning: Rank deficient, rank = 2, tol = 4.311227e-13.
> In Ex7study at 13
Error using surf (line 75)
Data dimensions must agree.
Error in Ex7exam6study (line 17)
surf(xx,yy,fxy)
clear;
clc;
% EXCERCISE 7 EXAM 6 STUDY GUIDE
% define the coordinates along x and y
x = -4.0:0.1:4.0;
y = -3.0:0.1:3.0;
% define the coordinates along the x-y plane
[xx,yy] = meshgrid(x,y);
% define and compute the given function along the x-y coordinates
fxy = (3.*xx.*yy)/(xx.^2+2*yy.^2);
% plot the function as a 3D mesh or surface
figure
surf(xx,yy,fxy)
shading interp

채택된 답변

Star Strider
Star Strider 2014년 11월 4일
You’re almost there!
You have to vectorise the division as well:
fxy = (3.*xx.*yy)./(xx.^2+2*yy.^2);
ADD DOT HERE ^
  댓글 수: 2
Jason
Jason 2014년 11월 4일
aahh Thank you! I cant believe I missed that!
Star Strider
Star Strider 2014년 11월 4일
My pleasure!
I still miss those little details as well. I suspect we all do from time to time.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by