Error in Acceleration (line 9)

I'm new in matlab and I'm stuck with this error for sometime, if someone could help
function [thetadotdot] = acceleration(r,g,a_c,theta,k0)
thetadotdot = ((g.*r.*sin(theta))+(a_c.*r.*cos(theta)))./k0^2;
end
clc;
clear;
theta = 0.25*pi; % 45 degrees in radians
g = 9.81; % acceleration due to gravity
m = 40; % mass in kilograms
r = 0.4; % radius in metres
k0 = 0.5; % radius of gyration in metres
a_c = 10*g; % deceleration in N/m2
thetadot = integral(@(thetadot) acceleration(r,g,a_c,theta,k0),0,45,'ArrayValued',true);
Error in Acceleration (line 9)
thetadot = integral(@(thetadot) acceleration(r,g,a_c,theta,k0),0,45,'ArrayValued',true);

3 个评论

I didn't get any error. Can you paste the complete error message?
Cannot find an exact (case-sensitive) match for 'acceleration'
The closest match is: Acceleration in C:\Users\RSula\OneDrive\Documents\MATLAB\Acceleration.m
Error in Untitled5>@(thetadot)acceleration(r,g,a_c,theta,k0)
Error in integralCalc/iterateArrayValued (line 156)
fxj = FUN(t(1)).*w(1);
Error in integralCalc/vadapt (line 130)
[q,errbnd] = iterateArrayValued(u,tinterval,pathlen);
Error in integralCalc (line 75)
[q,errbnd] = vadapt(@AtoBInvTransform,interval);
Error in integral (line 88)
Q = integralCalc(fun,a,b,opstruct);
Error in Acceleration (line 9)
thetadot = integral(@(thetadot) acceleration(r,g,a_c,theta,k0),0,45,'ArrayValued',true);
^^^this the whole error
sorry, it was a stupid mistake from me.. there were many files with same
it worked, thanks anyway for the help

请先登录,再进行评论。

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Matrix Indexing 的更多信息

产品

版本

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by