How do I draw the same graph as the picture?
1 次查看(过去 30 天)
显示 更早的评论
x1 = [4.158236141 6.153599506 -4.535940798 7.598349019 1.546377884 -1.345068203 9.996482015 -0.173832303 -4.963945249 7.601915038 6.858088405 6.026235301 3.704288407 3.26674903 3.077538527 3.32612663 3.171101989 9.937861391 9.863387191 -4.925131257];
x2 = [2.015908909 12.95555116 11.95848613 6.917196588 9.949209037 2.568895989 0.600398657 14.98330222 6.845564827 3.014910507 0.181581313 2.019090607 2.012738027 2.016006495 0 5.08610712 2.193143018 10.52404152 14.64506378 0.388181645];
v = [5.107328283 160.1220683 23.67014797 43.25143692 47.46188065 45.85372988 7.680346552 95.19501237 117.2067804 15.11163604 19.01778002 20.13095512 1.896743409 0.499697271 5.825451311 9.267063133 0.405543669 59.12461059 139.9629599 287.0573273];
F = scatteredInterpolant(x1',x2',v') ;
xi = 2.2 ;
yi = 7.2;
vi = F(xi,yi)
please let me know.
0 个评论
采纳的回答
KSSV
2021-5-10
x1 = [4.158236141 6.153599506 -4.535940798 7.598349019 1.546377884 -1.345068203 9.996482015 -0.173832303 -4.963945249 7.601915038 6.858088405 6.026235301 3.704288407 3.26674903 3.077538527 3.32612663 3.171101989 9.937861391 9.863387191 -4.925131257];
x2 = [2.015908909 12.95555116 11.95848613 6.917196588 9.949209037 2.568895989 0.600398657 14.98330222 6.845564827 3.014910507 0.181581313 2.019090607 2.012738027 2.016006495 0 5.08610712 2.193143018 10.52404152 14.64506378 0.388181645];
v = [5.107328283 160.1220683 23.67014797 43.25143692 47.46188065 45.85372988 7.680346552 95.19501237 117.2067804 15.11163604 19.01778002 20.13095512 1.896743409 0.499697271 5.825451311 9.267063133 0.405543669 59.12461059 139.9629599 287.0573273];
F = scatteredInterpolant(x1',x2',v') ;
m = 500 ; n = 500 ;
xi = linspace(min(x1),max(x1),m) ;
yi = linspace(min(x2),max(x2),n) ;
[X,Y] = meshgrid(xi,yi) ;
V = F(X,Y) ;
contourf(X,Y,V)
2 个评论
KSSV
2021-5-10
plot3(x1,x2,v,'.r') ;
hold on
plot3(X,Y,V,'.b') ;
legend('original','interpolated')
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graph and Network Algorithms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!