I have a .txt file with two columns of data. I run the following to open it and assign x and y:%Open file and extract x and y data
fid=fopen(fileput,'r');data=textscan(fid,'%d %d','headerlines',1); x=data{1}; y=data{2};fclose(fid);
My problem is when I attempt to use interp1 to find a value…
>> interp1(x,y,100)Error using interp1 (line 130)Values must be of type double or single.
I'm assuming it's got something to do with how I've assigned x and y, I've tried cell2mat(x) and got this error:
>> cell2mat(x)Cell contents reference from a non-cell array object.Error in cell2mat (line 42)cellclass = class(c{1});
Best Answer