13x8 Matrix Cubic Interpolation
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a matrix [13x8]. I want to cubic interpolate it to [50x8]. I tried "csapi" but I couldn't manage to figure it out.
[0.0000 0.0000 0.0000 0.0000 0.0000 0.0890 0.2860 0.4380;
0.0177 0.0648 0.0888 0.1070 0.1640 0.3680 0.5720 0.7040;
0.0594 0.1778 0.2445 0.3140 0.4250 0.6140 0.7650 0.8540;
0.2652 0.4723 0.6038 0.7260 0.8250 0.8970 0.9500 0.9820;
0.5436 0.7547 0.8852 0.9570 0.9800 0.9910 0.9980 1.0000;
0.7409 0.9056 0.9870 1.0000 1.0000 1.0000 1.0000 1.0000
0.7710 0.9260 0.9980 1.0000 1.0000 1.0000 1.0000 1.0000
0.7695 0.9260 0.9980 1.0000 1.0000 1.0000 1.0000 1.0000
0.6399 0.8297 0.9401 0.9710 0.9800 0.9850 0.9900 0.9920
0.3369 0.5788 0.7226 0.7780 0.8020 0.8270 0.8510 0.8770
0.0771 0.2463 0.3493 0.3890 0.4070 0.4300 0.4720 0.5360
0.0200 0.1019 0.1577 0.1770 0.1840 0.1940 0.2290 0.2990
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0200 0.0510];
댓글 수: 0
채택된 답변
Chris
2021년 10월 26일
편집: Chris
2021년 10월 26일
Like this?
V = [0.0000 0.0000 0.0000 0.0000 0.0000 0.0890 0.2860 0.4380;
0.0177 0.0648 0.0888 0.1070 0.1640 0.3680 0.5720 0.7040;
0.0594 0.1778 0.2445 0.3140 0.4250 0.6140 0.7650 0.8540;
0.2652 0.4723 0.6038 0.7260 0.8250 0.8970 0.9500 0.9820;
0.5436 0.7547 0.8852 0.9570 0.9800 0.9910 0.9980 1.0000;
0.7409 0.9056 0.9870 1.0000 1.0000 1.0000 1.0000 1.0000
0.7710 0.9260 0.9980 1.0000 1.0000 1.0000 1.0000 1.0000
0.7695 0.9260 0.9980 1.0000 1.0000 1.0000 1.0000 1.0000
0.6399 0.8297 0.9401 0.9710 0.9800 0.9850 0.9900 0.9920
0.3369 0.5788 0.7226 0.7780 0.8020 0.8270 0.8510 0.8770
0.0771 0.2463 0.3493 0.3890 0.4070 0.4300 0.4720 0.5360
0.0200 0.1019 0.1577 0.1770 0.1840 0.1940 0.2290 0.2990
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0200 0.0510];
surf(V)
F = griddedInterpolant(V,'cubic');
X = linspace(1,13,50);
Y = 1:8;
[XX,YY] = ndgrid(X,Y);
interpolated = F(XX,YY);
surf(interpolated)
댓글 수: 2
추가 답변 (2개)
Image Analyst
2021년 10월 26일
You can use imresize() to do bicubic interpolation, if you have the image Processing Toolbox
resizedMatrix = imresize(m, [50,8])
댓글 수: 0
John D'Errico
2021년 10월 26일
편집: John D'Errico
2021년 10월 26일
Simplest is to just read the help for interp2. It is silly to use a lower level tool when a high level tool does exactly what you want.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!