Hi,
I've been using MATLAB for quite a long time. However, in the new version (2019b) on Mac OSX, I'm facing an odd problem. I'm trying to use the cftool simply for fitting a gaussian function on a bell-shaped data (say x is my 1D array of independent variable, and y is another 1D array of the same size for the data). The fitting fails and an error message is displayed saying "Not enough input arguments". I also tried fitting other functions on the data and it seems that the problem is not limited to the gaussian fit and it similarly occurs for custom equation, exponential, Fourier, rational, power and sum of sines.
Nevertheless, the fitting on the same data is easily done by an old version on the same system (2016b). To resolve the issue I tried various things, but none worked.
I really appreciate any ideas on how to resolve this issue.
Best,

댓글 수: 1

I am not seeing that problem.
Experiment with
restoredefaultpath;
rehashtoolboxcache
and then see if it works. If it does work, then you have accidentally introduced something on your MATLAB path that is interfering with the fitting.

댓글을 달려면 로그인하십시오.

 채택된 답변

dariush ab
dariush ab 2019년 9월 22일

0 개 추천

Thank you Walter,
I tried the commands you suggested but the problem is not solved.
I have to add that I have recently installed the new version and the fitting was the first thing I was trying to do with it. I have not changed either the paths or anything else yet.
However, I have both 2016b and 2019b installed on the my computer. Could it possibly be the cause somehow? If yes, do you have any suggestions to resolve it (preferably, anything other than removing both versions and fresh installing the new one)?!
Cheers,

댓글 수: 7

Walter Roberson
Walter Roberson 2019년 9월 22일
Please show the complete error message showing which call of which function it is having the problem with.
dariush ab
dariush ab 2019년 9월 22일
편집: dariush ab 2019년 9월 22일
Please see the enclosed image.
Update: It appears that the problem originates from the user privileges.
So, the problem occurs when I run MATLAB from /Applications/PolySpace/R2019b/bin/matlab; while if the MATLAB exec file is called from Terminal with sudo, the problem is solved, though the graphics is sort of blurry in this case. Any ideas?!
Walter Roberson
Walter Roberson 2019년 9월 22일
Odd. But could be a path issue. In each of the two cases, examine output of path
dariush ab
dariush ab 2019년 9월 22일
I compared the output of “path” for the two cases. There is only a single difference between the two (among a long list of directories).
the one with sudo returns
/private/var/root/Documents/MATLAB
while without sudo I get
/Users/[myusername]/Documents/MATLAB
all the rest are exactly identical.
Walter Roberson
Walter Roberson 2019년 9월 22일
It could be significant. Look at ~/Documents/MATLAB to see the names of the .m files you have there; possibly one is interfering.
dariush ab
dariush ab 2019년 9월 22일
편집: dariush ab 2019년 9월 22일
Great! That was it. Thank you very much.
After emptying my ~/Documents/MATLAB folder, fitting works like a charm. Though, among a bunch of m files I have to check which one was conflicting with the curve fitting functions.
Perhaps, I had unintentionally saved an m file with the same name as one of the main functions of the curve fitting toolbox in the new version. right?
Walter Roberson
Walter Roberson 2019년 9월 23일
Could be, could be.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기

질문:

2019년 9월 22일

댓글:

2019년 9월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by