matrix interplation, increasing matrix elements 13 to 50

1 view (last 30 days)
I want to increase my matrix 13 rows to 50 rows with interpolation but not linear type. Could you help me?
0.0 0.0 0.0 0.0 0.0 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.0 0.0 0.0 0.0 0.0 0.0 0.0200 0.0510

Answers (2)

John D'Errico
John D'Errico on 30 Oct 2021
help interp2

DGM
DGM on 30 Oct 2021
Your matrix does not have 13 columns. it has 8 columns.
Decide whether you want to interpolate on rows or columns.
Decide what interplation type you want.
This is an example
A = [0.0 0.0 0.0 0.0 0.0 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.0 0.0 0.0 0.0 0.0 0.0 0.0200 0.0510];
w = size(A,2);
B = interp1(1:w,A.',linspace(1,w,50),'cubic').'
B = 13×50
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.0008 -0.0026 -0.0047 -0.0062 -0.0065 -0.0047 0 0.0071 0.0177 0.0258 0.0335 0.0407 0.0474 0.0537 0.0595 0.0648 0.0695 0.0735 0.0770 0.0801 0.0830 0.0859 0.0888 0.0914 0.0933 0.0950 0.0968 0.0991 0.1024 0.1070 0.1118 0.1162 0.1210 0.1272 0.1359 0.1478 0.1640 0.1854 0.0594 0.0795 0.0985 0.1165 0.1334 0.1492 0.1641 0.1778 0.1900 0.2005 0.2099 0.2184 0.2267 0.2353 0.2445 0.2539 0.2629 0.2719 0.2812 0.2910 0.3019 0.3140 0.3270 0.3404 0.3546 0.3698 0.3864 0.4047 0.4250 0.4482 0.2652 0.2994 0.3321 0.3632 0.3928 0.4208 0.4473 0.4723 0.4951 0.5157 0.5344 0.5521 0.5691 0.5862 0.6038 0.6219 0.6401 0.6580 0.6757 0.6930 0.7098 0.7260 0.7416 0.7568 0.7715 0.7857 0.7994 0.8125 0.8250 0.8369 0.5436 0.5787 0.6121 0.6439 0.6741 0.7026 0.7295 0.7547 0.7781 0.7996 0.8193 0.8376 0.8545 0.8703 0.8852 0.8990 0.9114 0.9226 0.9327 0.9418 0.9498 0.9570 0.9630 0.9675 0.9709 0.9735 0.9757 0.9778 0.9800 0.9822 0.7409 0.7695 0.7965 0.8217 0.8452 0.8670 0.8872 0.9056 0.9222 0.9369 0.9499 0.9613 0.9712 0.9797 0.9870 0.9926 0.9961 0.9980 0.9989 0.9992 0.9994 1.0000 1.0007 1.0009 1.0009 1.0007 1.0004 1.0001 1.0000 1.0000 0.7710 0.7982 0.8238 0.8476 0.8697 0.8902 0.9089 0.9260 0.9413 0.9547 0.9663 0.9764 0.9850 0.9921 0.9980 1.0020 1.0037 1.0039 1.0030 1.0016 1.0004 1.0000 1.0001 1.0001 1.0001 1.0001 1.0001 1.0000 1.0000 1.0000 0.7695 0.7970 0.8228 0.8469 0.8693 0.8899 0.9088 0.9260 0.9413 0.9548 0.9664 0.9765 0.9850 0.9921 0.9980 1.0020 1.0037 1.0039 1.0030 1.0016 1.0004 1.0000 1.0001 1.0001 1.0001 1.0001 1.0001 1.0000 1.0000 1.0000 0.6399 0.6719 0.7022 0.7310 0.7581 0.7836 0.8074 0.8297 0.8503 0.8693 0.8867 0.9025 0.9167 0.9292 0.9401 0.9489 0.9554 0.9601 0.9635 0.9661 0.9684 0.9710 0.9735 0.9753 0.9766 0.9776 0.9784 0.9791 0.9800 0.9809 0.3369 0.3775 0.4160 0.4526 0.4871 0.5197 0.5502 0.5788 0.6053 0.6296 0.6519 0.6723 0.6908 0.7076 0.7226 0.7354 0.7458 0.7542 0.7611 0.7670 0.7725 0.7780 0.7831 0.7871 0.7904 0.7933 0.7960 0.7988 0.8020 0.8055
  2 Comments
Salim Güven
Salim Güven on 30 Oct 2021
I'm sorry, that was must be 13 rows to 50. Can you do this for me. Thanx
DGM
DGM on 30 Oct 2021
A = [0.0 0.0 0.0 0.0 0.0 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.0 0.0 0.0 0.0 0.0 0.0 0.0200 0.0510];
w = size(A,1);
B = interp1(1:w,A,linspace(1,w,50),'cubic')
B = 50×8
0 0 0 0 0 0.0890 0.2860 0.4380 0.0021 0.0114 0.0156 0.0170 0.0312 0.1604 0.3646 0.5139 0.0057 0.0257 0.0351 0.0399 0.0682 0.2298 0.4377 0.5828 0.0107 0.0429 0.0587 0.0689 0.1110 0.2972 0.5052 0.6447 0.0171 0.0630 0.0863 0.1038 0.1597 0.3626 0.5671 0.6997 0.0222 0.0834 0.1153 0.1427 0.2133 0.4247 0.6218 0.7459 0.0261 0.1040 0.1456 0.1856 0.2720 0.4835 0.6692 0.7834 0.0348 0.1309 0.1832 0.2370 0.3375 0.5420 0.7132 0.8161 0.0546 0.1697 0.2343 0.3016 0.4117 0.6033 0.7573 0.8484 0.0896 0.2264 0.3060 0.3878 0.5017 0.6725 0.8055 0.8834

Sign in to comment.

Categories

Find more on Interpolation in Help Center and File Exchange

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!