Why when I debug my M Function this announcement always appear?

??? Error using ==> Michael
Too many input arguments.

7 Comments

Is there any particular action that triggers that?
Does it occur if you give the command
dbstep
If it does please check
where -all dbstep
Please also give the command
dbstatus
and show us any output you might get from that.
To confirm: it only occurs if you have debugging on, and not when you run the same commands without debugging?
Please also check
which -all Michael
let me check it. thx.
actually this is my function, and still cannot run the debug. it always appear in command:
??? Error using ==> Michael
Too many input arguments.
function qsalfig8_12
% Fixed test point. The applid force is randomly distributed
% The strength of particles increases due by repeated stressing due to
% rumooving of weakly particles from collective
M=10;
V=3;
N=10000; % Number of particles
G=11; % Number of applied forces used by every test
BFN=M+V*randn(1,N); % Breakage force (particel strength) distribution
% Mln = log(M^2 / sqrt(V^2+M^2))
% Vln = sqrt(log(V^2/M^2 + 1))
% BFL=lognrnd(Mln,Vln,1,N);
% BFw=1.185*wblrnd(10,4,1,N);
% BFr=M/2+V*rand(1,N)/0.289;
% BFe=4*wblrnd(2.5,1,1,N);
% mBFe=mean(BFe)
% SBFe=std(BFe)
% mBFr=mean(BFr);
% SBFr=std(BFr);
% % mBFL=mean(BFL);
% % SBFL=std(BFL);
% mBFw=mean(BFw);
% SBFw=std(BFw);
% [Fw Xw]=ecdf(BFw);
% % [FL XL]=ecdf(BFL);
% [Fn Xn]=ecdf(BFN);
% [Fr Xr]=ecdf(BFr);
% % [Fe Xe]=ecdf(BFe);
% figure(5);
% plot(Xn,Fn,'k',Xw,Fw,'k:',Xr,Fr,'k--','LineWidth',3);
% xlabel('Breakage force', 'FontSize', 16);
% ylabel('Cumulative probability','FontSize', 16);
% legend('normal','wbl','random');
BF=BFN;
ST=[mean(BF)];
L=length(BF);
% for n1=1:5;
[M,FnB]=dNumber(N,BF,G);
length(M)
P=disNumb(M,G,L);
SP=[1 1 0.4];
yf=expfitP(P,SP);
L=length(FnB);
N=length(FnB);
ST=[ST,mean(FnB)];
BF=FnB;
h=1:length(P);
NN=length(P);
X = fminsearch(@(x,p) qfit(x,P),[0.8]);
X
Pq=qyfit(X,P(1),NN);
figure(1)
plot(h,P,'ko',h,Pq,'k--','LineWidth',2);
legend('M-C data')
xlabel('Breakage number','FontSize', 16);
ylabel('Breakage probability','FontSize', 16);
% title('Breakage number distribution');
grid('on');
hold on;
% end;
% n2=1:length(ST);
% SP=[mean(BF) 1 0.4];
% sf=expfitP(ST,SP);
% figure(2)
% plot(n2,ST,'o',n2,sf);
function [M,FnB]=dNumber(N,BF,G);
M=[]; FnB=[]; d=0.2;
for n=1:N;
AF=10+3*randn(1,G);
MH=max(AF);m=1;
while BF(n)>=AF(m)& m<=length(AF)-1;
BF(n)=BF(n)*(1-d*AF(m)/mean(AF)); % To tacke into account the
m=m+1;
end;
c=1;
if m==G;
FnB=[FnB,BF(n)];
m=[];
end;
M=[M,m];
end;
function P=disNumb(R,G,TN);
p=[];
for k=1:G-1;
p=[p,sum(R==k)];
end;
p=p/TN;
P(1)=p(1);
for k=2:G-1;
P(k)=P(k-1)+p(k);
end;
function [Yfit]=expfitP(P,SP);
x=1:length(P);
y=P;
h=fittype('a*(1-b*exp(-c*x))');
[Y Par]=fit(x',y',h,'StartPoint',SP);
Y
Par
Yfit=Y(x);
function y=qfit(x,p);
N=length(p);
w=p(1);
Pfit(1)=w;
Nb(1)=1-w;
for k=2:N;
Nb(k)=Nb(k-1)*(1-w*x(1)^(k));
Pfit(k)=1-Nb(k);
end;
y=sum((p-Pfit).^2);
function P=qyfit(q,w,n);
v(1)=1-w; P(1)=w;
for j=2:n;
v(j)=v(j-1)*(1-w*q^(j));
P(j)=1-v(j);
end;
The word "Michael" doesn't appear in this text.
What does
which -all Michael
show in the command window?
yes, it is the name of file actually.
i hide my original name and replace it with 'Michael' in this forum.
and when I type on command :
which -all Michael
the display will be:
C:\Dokumente und Einstellungen\admin\Eigene Dateien\Downloads\michael.m
wunderbar!!!!!
It is run well.
Thx your idea.
I re copy my function and only put it in C foldr directly.
and it is worked.
many thx brother.

Sign in to comment.

 Accepted Answer

I don't know if Michael is actually this:
function qsalfig8_12
which is the first function in Michael.m, but that function does not take any arguments. If you're calling it with arguments, like
qsalfig8_12(42);
or
Michael(42);
you would get that error.

2 Comments

it is already worked brother. thx. I re-copy my file to C folder directly. and I run this file from C directly.

Sign in to comment.

More Answers (0)

Categories

Find more on Historical Contests in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!