"Plot" a matrix

34 ビュー (過去 30 日間)
Luciano Magrini
Luciano Magrini 2015 年 11 月 17 日
回答済み: Image Analyst 2015 年 11 月 18 日
Hello, dear members of this community! Can someone help me?
I have an array whose entries represent energy. Would I like to "plot" this array using a color palette, so you can quickly see the regions of high concentration of energy and also the low concentration of energy.
How can I do that? I thank anyone who can help.
Regards,

採用された回答

Star Strider
Star Strider 2015 年 11 月 17 日
There are several options, contour, contourf, surf, surfc, and others that those documentation pages link to. They will all take matrix arguments. Also see the colormap function to choose the color map that best depicts your data.
  2 件のコメント
Luciano Magrini
Luciano Magrini 2015 年 11 月 17 日
But these functions are not to generate 3D graphics?
In my case, I just want transform matrix on a color map.
Sorry for my comment, but I am new to matlab. Thank you for your contribution.
Star Strider
Star Strider 2015 年 11 月 18 日
the surf and similar functions will generate 3D graphics. The contour and related functions do not. It depends on what you want. Also, you can get a 2D surf plot with appropriate settings of the view function.
I encourage you to experiment with them and use the one that produces the result you want. I cannot determine that. I can only refer you to the appropriate functions.

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

その他の回答 (2 件)

Walter Roberson
Walter Roberson 2015 年 11 月 18 日
imagesc(YourArray)
colormap(hot(256))

Image Analyst
Image Analyst 2015 年 11 月 18 日
If you don't want 3D-ish graphics, then just use imshow(). It's in base MATLAB now. If you don't have it, use image() or imagesc().
imshow(yourMatrix, []);
colormap(jet(256)); % There are a variety of other built-in colormaps beyond jet.
colorbar;
Otherwise, see if any of the plots in the "MATLAB Gallery" are what you want: http://www.mathworks.com/discovery/gallery.html

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by