How could I fix an error in line 4 ("not enough arguments") of my routine?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Maria Perdomo
le 24 Juin 2013
Modifié(e) : Maria Perdomo
le 24 Juin 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 %*********************
Réponses (2)
Jan
le 24 Juin 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
le 24 Juin 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 commentaires
Voir également
Catégories
En savoir plus sur Descriptive Statistics and Visualization dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!