MATLAB: Interpolation Error using interp1

interp1interpolationMATLAB

I'm using a script to take these x and y values from a .txt file. At this point in the script the variables are assigned the fid is closed… When I code further, I'm trying to interpolate a user entered value which is called 'userx'.
Below, though, I am just trying to get it to interpolate at 100. I don't understand where my syntax error is.
>> x
x =
0
20
22
30
33
52
52
67
84
101
103
111
116
132
141
159
162
168
171
173
>> y
y =
8477
11886
11384
6087
7871
3003
1941
9213
10981
2179
2219
507
1593
8880
11650
4392
6118
4437
2094
1961
>> interp1(x,y,100) Error using interp1 (line 130) Values must be of type double or single.
>>

Best Answer

Check the data types of x and }y}. My guess is that they are either cells or strings.
If they are cells, you can convert them to double arrays with:
x = x{:};
y = y{:};