How could I fix an error in line 4 ("not enough arguments") of my routine?
1 view (last 30 days)
Show older comments
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 Comments
Maria Perdomo
on 24 Jun 2013
Edited: Maria Perdomo
on 24 Jun 2013
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 %*********************
Answers (2)
Jan
on 24 Jun 2013
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)
Maria Perdomo
on 24 Jun 2013
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
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!