Unable to use function in script
Show older comments
I am new to matlab, i created a function file and it is working fine while using in command winow but showing "Not enough input arguments." while using in a script
function [V,A,Up,dV,dA] = VAUt(ct,B,L,r,R,Ach,Ap,N)
B = B*0.0254;
L = L*0.0254;
Ach = Ach*0.00064516;
Ap = Ap*0.00064516;
Vd = 22*(B^2)*L/28;
Vc = Vd/(r-1);
V = Vc*(1+0.5*(r-1)*(R+(1- cosd(ct))-((R^2)-((sind(ct))^2))^0.5));
A = Ach + Ap + 22*B*L*(R+1-cosd(ct)+((R^2)-(sind(ct))^2))/14;
Up = 22*L*N*sind(ct)*(cosd(ct)/(((R^2)-(sind(ct))^2)^0.5)+1)/7;
dV = Vc*(R/2 - cos((pi*ct)/180)/2 - (R^2 - sin((pi*ct)/180)^2)^(1/2)/2 + 1/2);
dA = (11*B*L*((pi*sin((pi*ct)/180))/180 - (pi*cos((pi*ct)/180)*sin((pi*ct)/180))/90))/7;
end
in = [15,14,14,9,6,231,154,1500];
[Vt,At,Upt,dVt,dAt] = VAUt(in);
A = [Vt,At,Upt,dVt,dAt];
for i = 0:1:36
in(1) = i*5;
A(:,:,i) = VAUt(in);
end
Accepted Answer
More Answers (0)
Categories
Find more on Tracking and Motion Estimation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!