What does "Attempt to execute SCRIPT fitdist as a function" mean?

This is probably really simple, but I'm a beginner. Every time I try to use the histfit function in any script lately, I get the error message:
Error using histfit (line 69)
Attempt to execute SCRIPT fitdist as a function:
But I never have problems with regular hist or any statistic functions.
Is there something wrong with the way I'm importing data from text files?
Here's a smaller example of what I'm trying to do:
s=importdata('Data1.txt')
figure;
hist(s)
figure(2);
histfit(s)

2 Comments

Looks like you've inadvertently created a script named fitdist.m that is aliasing the TMW function of the same name.
Type
which fitdist
at the command line to see what it is being resolved to. If it's something other than something like
C:\...\toolbox\stats\stats\fitdist.m
that's the problem; remove that file or rename it something not in conflict with Matlab function name if it's needed local content.
Thank you, that was the exact problem

Sign in to comment.

Answers (0)

Asked:

on 23 Nov 2015

Commented:

on 26 Nov 2015

Community Treasure Hunt

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

Start Hunting!