MATLAB Answers

problem in generate code using cftool

10 views (last 30 days)
fereshte on 22 May 2014
Edited: fereshte on 24 May 2014
hi.i obtain mean of coloumn in matrix and curve fitting by cftool. then save generate code of it. but when I call it in the my code gives me an error message. What can I do?
% mean of matrix meanValue = mean(G);
x=1:1:47; y=meanValue; n=createFit(x,meanValue);
error is:
??? Error using ==> createFit Too many output arguments.
Error in ==> pixel at 35 n=createFit(x,meanValue);
thank you


Sign in to comment.

Answers (1)

Geoff Hayes
Geoff Hayes on 22 May 2014
Check the signature of the createFit function. Does it actually return something? i.e. if the signature is just:
function createFit(x,y)
then you will get the too many output arguments error since the above code is
i.e. the code is trying to get the return value of a function that does not return anything. There seems to be different versions of createFit on the MATLAB FileExchange and elsewhere too, so please verify that you are using the expected/correct version. I was able to reproduce your error using the code found at


fereshte on 23 May 2014 original code isnt relevante to create is part of my project. create fit code generate by cftool.i dont write it.
Geoff Hayes
Geoff Hayes on 23 May 2014
I think that we have covered why you were getting the error (that you posted). Is there something else that is preventing you from moving forward?
fereshte on 24 May 2014
no,just this.i want do curve fitting by gaussian in part of my project but i cannot..

Sign in to comment.

Sign in to answer this question.