Plot of a three dimensional matrix
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
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일
0 개 추천
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.
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!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 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)
