Interpolate 2D array at certain point

I have a 8x32 table with values of interest that correspont to points defined by the first row and the first column.
The values of the table at the first column are inside [1,20] and the values of the first row are inside [0.0012,5]
Here's what I need to do:
For a certain point, let's say (1.005 , 5.5) , I want my script to load the matrix, interpolate it's values and return the corresponding value to the given point.
During my tries I kept on receiving the error:
Error using .' (line 191)
Undefined function 'transpose' for input arguments of type 'table'.
Error in interp2 (line 122)
V = V.';
The code I've tried was:
load('bw20')
interp2(bw20(1,2:32),bw20(2:8,1),bw20,1.005,5.5);

2 Comments

What is bw20?
If it is a table you likely need to call its values as
bw20{1,2:32}
rather than use parenthesis which, I think, returns a sub-table rather than a numeric array. Table inputs are not supported by interp2. I'm surprised it gets as far as it does into the function before complaining about that.
Apparently seems like that the problem is that I'm a newbie on matlab :p
In case someone else is struggling into that, the problem was that the inputs of interp2 were tables and not doubles. Thanks for your time.

Sign in to comment.

Answers (0)

Products

Release

R2018b

Tags

Asked:

on 31 Oct 2019

Commented:

on 31 Oct 2019

Community Treasure Hunt

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

Start Hunting!