Error on contour plot stability region Runngekutta

조회 수: 2 (최근 30일)
Janvier Solaris
Janvier Solaris 2017년 11월 10일
댓글: Walter Roberson 2017년 11월 11일
Hello I am trying to plot a region of stability of the Runge Kutta 4th order here is the following code in a script
[X,Y] = meshgrid(-5:0.01:5,-5:0.01:5);
Mu = X+i*Y;
R = 1 + Mu + .5*Mu.^2 + (1/6)*Mu.^3 + (1/24)*Mu.^4;
Rhat = abs(R);
contourplot(X,Y,Rhat,[1]);
I get the error that contourplot is an undefined function. the contour plot should look like this :
Any help would be appreciated

채택된 답변

Walter Roberson
Walter Roberson 2017년 11월 10일
contourplot() is not a function defined by Mathworks, and it does not appear to be defined by any File Exchange contributions either.
The contour() routine provided by MATLAB would only draw outlines. The contourf() routine would fill those outlines, but with constant colors, not with a shaded surface like that.
  댓글 수: 2
Janvier Solaris
Janvier Solaris 2017년 11월 10일
Thank you for your answer Walter; Is there any way to get it to look just like the outline of the shape? I have tried contourf and it does just what you said but with no discernable shape
Walter Roberson
Walter Roberson 2017년 11월 11일
I would suggest
surf(X, Y, Rhat, 'edgecolor', 'none');
colormap(gray(256))
lighting gouraud

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by