フィルターのクリア

Why do I get this error in the code?

1 回表示 (過去 30 日間)
Samuel Davies
Samuel Davies 2015 年 7 月 26 日
回答済み: Walter Roberson 2015 年 7 月 26 日
So I put this code in from an example, http://au.mathworks.com/help/matlab/ref/colormap.html, and changed the surf to mesh. I get this error: Subscript indices must either be real positive integers or logicals.
figure
ax1 = subplot(2,1,1);
mesh(peaks)
colormap(ax1,spring)
ax2 = subplot(2,1,2);
mesh(peaks)
colormap(ax2,winter)
This is the error message
Error in surf (line 4)
colormap(ax1,spring)
I don't know what is wrong. Thanks.
  1 件のコメント
Walter Roberson
Walter Roberson 2015 年 7 月 26 日
You should not name your file surf.m as that is going to conflict with the MATLAB surf() command.

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2015 年 7 月 26 日
In the code or script not shown, you possibly have created a variable named "colormap".

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeColormaps についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by