Info

This question is closed. Reopen it to edit or answer.

How to interpolate (rephrased from previous question) ?

1 view (last 30 days)
hithere
hithere on 2 Nov 2014
Closed: MATLAB Answer Bot on 20 Aug 2021
Lets say I have Matric A (3x4) and B (5x3)
A = 1 3 6 8
4 6 7 9
5 8 8 12
B = 1 4 6
2 5 5
3 4 6
6 8 9
5 7 4
and matrix C (9x1 matrix). which is a unique(a(:));
C=unique(A(:));
and C became:
C = 1
3
4
5
6
7
8
9
10
The purpose of A and B is such that. The all ROWS of B will be plotted as y-axis against column 1 of A as x-axis, then all ROWS of B against column 2 of A, then all ROWS of B against column 3 of A so on and till column 4 of A.
I want to interpolate B to have 10 points so that I can plot it against C.
D = interp1(A,B,C)
but was reflected
??? Error using ==> interp1 at 123
X must be a vector.
Not sure if is possible to interpolate like this. or is there any other way i can do this.
My intention is
D1 = interp1(""first column of A"",B,C)
D2 = interp1(""2nd column of A"",B,C)
D3 = interp1(""3rd column of A"",B,C)
So that all Ds are 5x10 matrix
May I know the proper command to go about this.
  2 Comments
Harry
Harry on 2 Nov 2014
Edited: Harry on 2 Nov 2014
Why did you delete my previous comments? If you respond to my previous comments, then I will give you the code.
hithere
hithere on 2 Nov 2014
Edited: hithere on 2 Nov 2014
i actually deleted the whole question and i cant delete comments anyway. cause i read through it and didnt make sense to me too. so i rephrased and posted this.

Answers (0)

Community Treasure Hunt

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

Start Hunting!