I have attached the data file I am referencing. I need to separated the x-values and the y-values into two separate vectors. This is what I have created:
function [x,y]= week8_4_1(filepath)
mat=fscanf(fid,'x %f y %f\n',[2,inf]);
disp('File could not be closed');
disp('File closed successfully');
I keep getting an error when I try to run the program saying:
Index in position 1 exceeds array bounds.
Error in week8_4_1 (line 11)
I'm not sure what is wrong with my code. Any help is appreciated!