error on predfind function spap2

3 views (last 30 days)
ravi biradar
ravi biradar on 22 Jul 2015
Edited: Jan on 22 Jul 2015
I am trying to run simple script using spap2 as follows
X=(4*pi)8[0 1 rand(1,20)];
Y=sin(X);
cs=spap2(X,Y);
I am getting error as undefined function 'spap2' for input arguments of type 'double'
  2 Comments
Stephen23
Stephen23 on 22 Jul 2015
This time I formatted your code for you, but in future please use the {} Code button that you will find above the textbox.
Jan
Jan on 22 Jul 2015
This is not a valid line of code:
X=(4*pi)8[0 1 rand(1,20)];
Please post the correct code you are using.

Sign in to comment.

Answers (1)

Jan
Jan on 22 Jul 2015
Edited: Jan on 22 Jul 2015
Did you read the documentation of http://www.mathworks.com/help/curvefit/spap2.html ? Please run the examples given there to find out, how to call this function.
Do the examples run? Then the error message means, that the 1st input cannot be a double. If they do not run: Do you have a license for the curve fitting toolbox?

Community Treasure Hunt

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

Start Hunting!