Plot of a three dimensional matrix
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
Suppose I have a three dimensional matrix where the first index is the city, the second index is time. and the third index is temparature. I want to create a plot where the x axis is time. and y axis is the temperature of each city. Please advise how to proceed.
採用された回答
Image Analyst
2017 年 12 月 28 日
Open the Volume Viewer App
- MATLAB® Toolstrip: Open the Apps tab, under Image Processing and Computer Vision, click the Volume Viewer app icon. Or...*
- MATLAB command prompt: Enter volumeViewer.
11 件のコメント
alpedhuez
2017 年 12 月 28 日
Thank you. What will be the corresponding code?
Walter Roberson
2017 年 12 月 28 日
volumeViewer does not support passing in coordinate vectors for the coordinates. There would not be any way for passing in meaningful names for the cities.
volumeViewer does support passing in a 4 x 4 reference matrix. That could be used to pass scaling and translation information for the time and temperature matrices.
alpedhuez
2017 年 12 月 28 日
I would like to understand the code to write in the script. Thank you very much.
Walter Roberson
2017 年 12 月 28 日
volumeViewer(Your3DMatrix)
Image Analyst
2017 年 12 月 28 日
編集済み: Image Analyst
2017 年 12 月 28 日
Wait a minute. This does not seem like a 3-D matrix. If index 1 is the city number, and index 2 is the time index, and index 3 is the temperature index, then what is the value? For example, let's say we're looking at city #2, time point #4, and temperature index of 3. OK, fine, but what is the value stored at data(2, 4, 3)? It's not the temperature because that is the third index. So what is it? Is it the wind speed? Is it the cloud cover fraction? What is it???
OR do you actually have a 2-D array where for each city number and for each time point you have a single temperature? If so, you can simply use imshow() to show that 2-D temperature matrix, applying a colormap if you want. Or you could use surf() if you'd like a 3-D-ish perspective rendering.
alpedhuez
2017 年 12 月 28 日
I mean, the data is the temperature of a city (LA, NY) in Jan-Dec. The output has temperatures of LA and NY in Y-axis and Jan-Dec in X-axis.
Image Analyst
2017 年 12 月 28 日
OK, you threw us by calling it a 3-D data situation. What you have is a 2-D situation, NOT 3-D, and you can use 2-D ways of displaying it, like imshow(), imagesc(), image(), or surf().
To be clear, consider the table
NY Jan 30
NY Feb 40
NY Mar 50
LA Jan 40
LA Feb 50
LA Mar 60
Then I want to define a variable LAtemp ={30,40,50} and also I want to have a plot with NY, LA temperature on Y axis and Months on X axis.
Image Analyst
2017 年 12 月 28 日
Does anyone else understand this, or is it just me? What is LAtemp used for? Does he want a 2-D bar chart? Why not simply extract values for each city and plot them as a function of month?
alpedhuez
2017 年 12 月 28 日
Yes. My question is "is there a simpler way than 'extract values for each city and plot them as a function of month'"?
Walter Roberson
2017 年 12 月 28 日
The simpler ways of extract the values requires that the same number of months be present for each city and that all of the data for one city be together and sorted by month. In that case, take the temperature column as numeric and reshape() it by the number of entries per city so that all of the entries for one city go into a column. Then you can plot() the 2D array.
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Lighting, Transparency, and Shading についてさらに検索
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
