Having A problem with surfc
Información
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Mostrar comentarios más antiguos
X = 0:10; %This a range from 1 to 100 cities in MA
Y = 0:25; %In the year 2012
%1 2 3 4 5 6 7 8 9 10
Z = [27 630 72 12 32 26 253 567 203 28;
315 132 16 113 642 38 560 19 5 87;
2076 1992 58 243 352 185 218 15 28 32;
543 618 37 13 53 5647 490 48 21 11;
742 450 30 1082 4 148 12 50 1196 566;
92 201 84 58 189 704 394 64 8 68;
102 193 113 48 50 267 66 27 44 74;
2808 460 177 254 20 66 52 460 33 14;
27 16 53 302 95 93 174 35 22 17;
1122 306 956 1195 682 2 544 1213 938 152];
Xi = 0:.1:10;
Yi = 0:.1:10;
[Xi, Yi] = meshgrid(Xi, Yi);
surfc(Xi, Yi);
Respuestas (1)
Rik
el 25 de Nov. de 2017
Read the documentation. I suspect your problem will be solved by using the surfc(X,Y,Z) syntax. The code below produces a plot, see if it suites your need.
Z = [27 630 72 12 32 26 253 567 203 28;...
315 132 16 113 642 38 560 19 5 87; ...
2076 1992 58 243 352 185 218 15 28 32; ...
543 618 37 13 53 5647 490 48 21 11; ...
742 450 30 1082 4 148 12 50 1196 566; ...
92 201 84 58 189 704 394 64 8 68; ...
102 193 113 48 50 267 66 27 44 74; ...
2808 460 177 254 20 66 52 460 33 14; ...
27 16 53 302 95 93 174 35 22 17; ...
1122 306 956 1195 682 2 544 1213 938 152];
vec=linspace(0,10,10);%edit to fit your data
[Xi, Yi] = meshgrid(vec, vec); surfc(Xi, Yi,Z);
(I made sure the code is readable by selecting the code and then using the {}Code button. Please do so as well next time you post code.)
1 comentario
Jasmine Andrade
el 25 de Nov. de 2017
La pregunta está cerrada.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!