简体   繁体   中英

3D Graph in MATLAB

I want to draw a graph in MATLAB like this:

图形

I have this dataset:

资料集

I tried to use this code:

s = [0  25  50  75  100]; 
t = [0; 25; 50; 75; 100]; 
[ss, tt] = meshgrid(s,t); 
u = [198 237 280 324 370; 
     237 270 310 354 399;
     280 310 348 390 434; 
     324 354 390 431 474; 
     370 399 434 474 516]; 

figure 
surf(ss,tt,u); 
rotate3d on 
xlabel('S[%]'); 
ylabel('T[%]'); 
zlabel('Umed[V]');

but I got this:

输出

What is wrong?

As Phil says, your plot shows more points than the table you are showing. For instance, your table lists 5 points in the 'x' direction, but your plot looks like it has perhaps 100. So your code should produce the desired result once you use the "full" dataset.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM