Error on contour plot stability region Runngekutta
2 次查看(过去 30 天)
显示 更早的评论
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 :
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/169478/image.jpeg)
Any help would be appreciated
0 个评论
采纳的回答
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 个评论
Walter Roberson
2017-11-11
I would suggest
surf(X, Y, Rhat, 'edgecolor', 'none');
colormap(gray(256))
lighting gouraud
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Contour Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!