![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/181644/image.jpeg)
How can I plot 3d plot of this data?
조회 수: 1 (최근 30일)
이전 댓글 표시
I have an array of size 300x3. Three columns having data of say A,B and C variables such that range of A and B is between 0 and 1 and C's range vary i.e. my array looks like following:
A=====B=====C
0.1===0.1====x
0.1===0.2====x
0.1===0.3====x
.
.
.
0.1====1====x
0.2===0.1===x
0.2===0.2===x
and so on... I want to plot 3d plot with A,B and C on x,y and z axis respectively. Please help.
댓글 수: 0
채택된 답변
Mamoru Takahashi
2018년 1월 31일
편집: Mamoru Takahashi
2018년 1월 31일
At first, why is the size of the array 300*3 ? Don't you mean 100*3 ?
If so, I'd like you to try the following manners.
1): Create the coordinate for x and y, respectively.
x=(0.1:0.1:1)'
y=(0.1:0.1:1)'
2): Convert the size of "C" from 100*1 to 10*10.
C=(1:100)'; % Showing just an example.
>> CC=reshape(C,10,10)
CC =
1 11 21 31 41 51 61 71 81 91
2 12 22 32 42 52 62 72 82 92
3 13 23 33 43 53 63 73 83 93
4 14 24 34 44 54 64 74 84 94
5 15 25 35 45 55 65 75 85 95
6 16 26 36 46 56 66 76 86 96
7 17 27 37 47 57 67 77 87 97
8 18 28 38 48 58 68 78 88 98
9 19 29 39 49 59 69 79 89 99
10 20 30 40 50 60 70 80 90 100
3): Illustrate figure.
contour3(x,y,CC)
and you'll obtain,
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/181644/image.jpeg)
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!