几种二维插值法的比较

更新时间:2024-01-05 06:58:01 阅读量: 教育文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

几种二维插值法的比较:

>> x=0:400:5600; y=0:400:4800;

z=[370 470 550 600 670 690 670 620 580 450 400 300 100 150 250;

510 620 730 800 850 870 850 780 720 650 500 200 300 350 320;... 650 760 880 970 1020 1050 1020 830 900 700 300 500 550 480 350;... 740 880 1080 1130 1250 1280 1230 1040 900 500 700 780 750 650 550;... 830 980 1180 1320 1450 1420 1400 1300 700 900 850 840 380 780 750;... 880 1060 1230 1390 1500 1500 1400 900 1100 1060 950 870 900 930 950;...

910 1090 1270 1500 1200 1100 1350 1450 1200 1150 1010 880 1000 1050 1100;... 950 1190 1370 1500 1200 1100 1550 1600 1550 1380 1070 900 1050 1150 1200;... 1430 1430 1460 1500 1550 1600 1550 1600 1600 1600 1550 1500 1500 1550 1550;... 1420 1430 1450 1480 1500 1550 1510 1430 1300 1200 980 850 750 550 500;... 1380 1410 1430 1450 1470 1320 1280 1200 1080 940 780 620 460 370 350;... 1370 1390 1410 1430 1440 1140 1110 1050 950 820 690 540 380 300 210;... 1350 1370 1390 1400 1410 960 940 880 800 690 570 430 290 210 150];

figure(1); meshz(x,y,z)

>> x1=0:50:5600; >> y1=0:50:4800;

>> z1=interp2(x,y,z,x1,y1','nearest'); >> figure(2);

>> mesh(x1,y1,z1) >> x1=0:50:5600; >> y1=0:50:4800;

>> z1=interp2(x,y,z,x1,y1','linear'); >> figure(3);

>> mesh(x1,y1,z1) >> x1=0:50:5600; >>y1=0:50:4800;

>>z1=interp2(x,y,z,x1,y1','cubic'); >>figure(4);

>> mesh(x1,y1,z1) >>x1=0:50:5600; >> y1=0:50:4800;

>> z1=interp2(x,y,z,x1,y1','spline'); >>figure(5);

>> mesh(x1,y1,z1)

200015001000500060004000400020000020006000

200015001000500060004000400020000020006000

200015001000500060004000400020000020006000

200015001000500060004000400020000020006000200015001000500060004000400020000020006000

>> x=0:400:5600; >>y=0:400:4800;

>>z=[370 470 550 600 670 690 670 620 580 450 400 300 100 150 250; 510 620 730 800 850 870 850 780 720 650 500 200 300 350 320;... 650 760 880 970 1020 1050 1020 830 900 700 300 500 550 480 350;... 740 880 1080 1130 1250 1280 1230 1040 900 500 700 780 750 650 550;... 830 980 1180 1320 1450 1420 1400 1300 700 900 850 840 380 780 750;... 880 1060 1230 1390 1500 1500 1400 900 1100 1060 950 870 900 930 950;...

910 1090 1270 1500 1200 1100 1350 1450 1200 1150 1010 880 1000 1050 1100;... 950 1190 1370 1500 1200 1100 1550 1600 1550 1380 1070 900 1050 1150 1200;... 1430 1430 1460 1500 1550 1600 1550 1600 1600 1600 1550 1500 1500 1550 1550;... 1420 1430 1450 1480 1500 1550 1510 1430 1300 1200 980 850 750 550 500;... 1380 1410 1430 1450 1470 1320 1280 1200 1080 940 780 620 460 370 350;... 1370 1390 1410 1430 1440 1140 1110 1050 950 820 690 540 380 300 210;... 1350 1370 1390 1400 1410 960 940 880 800 690 570 430 290 210 150]; >> figure(1);

>> contour(x,y,z,10) >> x1=0:50:5600; >>y1=0:50:4800;

>>z1=interp2(x,y,z,x1,y1','nearest'); >>figure(2);

>> contour(x1,y1,z1,10) >> x1=0:50:5600; >>y1=0:50:4800;

>>z1=interp2(x,y,z,x1,y1','linear'); >>figure(3);

>> contour(x1,y1,z1,10) >> x1=0:50:5600; >>y1=0:50:4800;

>>z1=interp2(x,y,z,x1,y1','cubic'); >>figure(4); |

>> contour(x1,y1,z1,10) >> x1=0:50:5600; >>y1=0:50:4800;

>>z1=interp2(x,y,z,x1,y1','spline'); >>figure(5); |

>> contour(x1,y1,z1,10)

450040003500300025002000150010005000010002000300040005000

450040003500300025002000150010005000010002000300040005000

450040003500300025002000150010005000010002000300040005000

450040003500300025002000150010005000010002000300040005000

450040003500300025002000150010005000010002000300040005000

本文来源:https://www.bwwdw.com/article/jt8x.html

Top