필터 지우기
필터 지우기

13x8 Matrix Cubic Interpolation

조회 수: 1 (최근 30일)
Esat Akdöngel
Esat Akdöngel 2021년 10월 26일
답변: Image Analyst 2021년 10월 26일
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];

채택된 답변

Chris
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
Esat Akdöngel
Esat Akdöngel 2021년 10월 26일
Yes thank you for the answer,how can i take the values from this model i need the values actually
Chris
Chris 2021년 10월 26일
The values are in the matrix "interpolated."
Or use interp2.

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Image Analyst
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])

John D'Errico
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.

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by