How could I fix an error in line 4 ("not enough arguments") of my routine?

1 回表示 (過去 30 日間)
Borja
Borja 2013 年 6 月 24 日
function [dados, Vx, Vy] =PLineares(AP,ML,SR) pi=3.141592653589793238; z=1.645; n=length(AP); dt=SR/n; T=dt*n; %------------------------------------------ APcm=AP*100;MLcm=ML*100; dx=diff(abs(APcm));dy=diff(abs(MLcm)); for i=1:n-1 DOT_(i)=(APcm(i+1)-APcm(i))^2+(MLcm(i+1)-MLcm(i))^2; end DOT_AP= norm(APcm);DOT_ML= norm(MLcm); DOT = sqrt(DOT_AP^2+DOT_ML^2); %------------------------------------------ Vap=DOT_AP/T;Vml=DOT_ML/T;Vr=DOT/T; dx=diff(APcm); dy=diff(MLcm); %------------------------------------------ Vx=dx./dt;Vy=dy./dt; Vx(n)=Vx(n-1);Vy(n)=Vy(n-1); %**************************************** ACPap = max(APcm) - min(APcm); ACPml = max(MLcm) - min(MLcm); V = cov(APcm,MLcm); [vec,val] = eig(V); axes = 2.4478*sqrt(svd(val)); Area = pi*prod(axes); %-------------------------------------------------------------- dados(1)=DOT;dados(2)=DOT_AP; dados(3)=DOT_ML; dados(4)=ACPap;dados(5)=ACPml;dados(6)=Area; dados(7)=Vr; dados(8)=Vap;dados(9)=Vml; %-------------------------------------------------------------- %************************* %* Fim da Rotina %************************
  3 件のコメント
Maria Perdomo
Maria Perdomo 2013 年 6 月 24 日
編集済み: Maria Perdomo 2013 年 6 月 24 日
Wich one is your line four?
function [dados, Vx, Vy] =PLineares(AP,ML,SR)
pi=3.141592653589793238;
z=1.645;
n=length(AP); %%%%IS THIS YOUR LINE FOUR?????
dt=SR/n;
T=dt*n;
%------------------------------------------
APcm=AP*100;
MLcm=ML*100;
dx=diff(abs(APcm));
dy=diff(abs(MLcm));
for i=1:n-1
DOT_(i)=(APcm(i+1)-APcm(i))^2+(MLcm(i+1)-MLcm(i))^2;
end
DOT_AP= norm(APcm);
DOT_ML= norm(MLcm);
DOT = sqrt(DOT_AP^2+DOT_ML^2)
%------------------------------------------
Vap=DOT_AP/T;
Vml=DOT_ML/T;
Vr=DOT/T;
dx=diff(APcm);
dy=diff(MLcm);
%------------------------------------------
Vx=dx./dt;Vy=dy./dt; Vx(n)=Vx(n-1);Vy(n)=Vy(n-1);
%****************************************
ACPap = max(APcm) - min(APcm);
ACPml = max(MLcm) - min(MLcm);
V = cov(APcm,MLcm);
[vec,val] = eig(V);
axes = 2.4478*sqrt(svd(val));
Area = pi*prod(axes);
%--------------------------------------------------------------
dados(1)=DOT;
dados(2)=DOT_AP;
dados(3)=DOT_ML;
dados(4)=ACPap;
dados(5)=ACPml;
dados(6)=Area;
dados(7)=Vr;
dados(8)=Vap;
dados(9)=Vml;
%--------------------------------------------------------------
%************************* %* Fim da Rotina %*********************
Borja
Borja 2013 年 6 月 24 日
Yes it is...

サインインしてコメントする。

回答 (2 件)

Jan
Jan 2013 年 6 月 24 日
How did you call this program? Did you define the required input arguments? The correct calling method is typing this into the command window, a script or a function:
[dados, Vx, Vy] = PLineares(AP, ML, SR)
  1 件のコメント
Borja
Borja 2013 年 6 月 24 日
Hi
If I type what you say into the command window the message is
Undefined function or variable AP

サインインしてコメントする。


Maria Perdomo
Maria Perdomo 2013 年 6 月 24 日
Borja,
you have to give values to AP ML and SR. For example:
[dados, Vx, Vy] = PLineares([1 2 3], [1 2 3], 3)
please notice that your code requires AP and ML to be the same size

カテゴリ

Help Center および File ExchangeResampling Techniques についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by