用matlab作三维散点图u=[3.754\x05 7.179\x050.197\x05133.747\x057.166\x050.183\x05173.737\x057.147\x050.169\x05243.734\x057.141\x050.156\x05153.739\x057.150\x050.145\x05163.751\x057.170\x050.191\x05143.742\x057.152\x050.175\x05123.745\x057.158\x
来源:学生作业帮助网 编辑:六六作业网 时间:2025/01/09 07:02:51
用matlab作三维散点图u=[3.754\x05 7.179\x050.197\x05133.747\x057.166\x050.183\x05173.737\x057.147\x050.169\x05243.734\x057.141\x050.156\x05153.739\x057.150\x050.145\x05163.751\x057.170\x050.191\x05143.742\x057.152\x050.175\x05123.745\x057.158\x
用matlab作三维散点图
u=[3.754\x05 7.179\x050.197\x0513
3.747\x057.166\x050.183\x0517
3.737\x057.147\x050.169\x0524
3.734\x057.141\x050.156\x0515
3.739\x057.150\x050.145\x0516
3.751\x057.170\x050.191\x0514
3.742\x057.152\x050.175\x0512
3.745\x057.158\x050.164\x0515
3.731\x057.131\x050.155\x0515
3.736\x057.137\x050.164\x058
3.739\x057.143\x050.156\x0516
3.732\x057.126\x050.157\x0511]
x=u(:,1)
y=u(:,2)
z=u(:,4)
这样的形成一个三维面 看得出高低
用matlab作三维散点图u=[3.754\x05 7.179\x050.197\x05133.747\x057.166\x050.183\x05173.737\x057.147\x050.169\x05243.734\x057.141\x050.156\x05153.739\x057.150\x050.145\x05163.751\x057.170\x050.191\x05143.742\x057.152\x050.175\x05123.745\x057.158\x
先提醒你一下,你的x,y是不能哪样定义的,要不然z就必须得是12*12阶矩阵
因此,你的x要么是1*12阶矩阵,y就是1*3阶矩阵;x要么是1*3阶矩阵,y就是1*12阶矩阵;这样才能符合你给出u矩阵 .
现在给你的一些命令:
>>x=1:12;y=1:3;
>>u=[3.754 7.179 0.197 13
3.7477.1660.18317
3.7377.1470.16924
3.7347.1410.15615
3.7397.1500.14516
3.7517.1700.19114
3.7427.1520.17512
3.7457.1580.16415
3.7317.1310.15515
3.7367.1370.1648
3.7397.1430.15616
3.7327.1260.15711];
>>z=[u(:,1)',u(:,2)',u(:,4)'];
>>mesh(x,y,z)
我采用插值拟合给出你要的效果图
>>xi=1:0.1:12;yi=1:0.1:3;
>>zi=interp2(x,y,z,xi',yi,'cubic');
>>mesn(xi,yi,zi)
最终得到的图形