How can I plot 3d plot of this data?

2 visualizaciones (últimos 30 días)
Luqman Saleem
Luqman Saleem el 30 de En. de 2018
Comentada: Luqman Saleem el 31 de En. de 2018
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.

Respuesta aceptada

Mamoru Takahashi
Mamoru Takahashi el 31 de En. de 2018
Editada: Mamoru Takahashi el 31 de En. de 2018
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,
For the property configurations of the figure, please see Contour Plots

Más respuestas (0)

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by