Not enough input arguments.
정보
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
I'm attempting to make a simple m file which plots solutions to a force problem given a range of theta and generates the resulting mass (m) required for equilibrium. So far, my code doesn't account for solving for m, but I'm just trying to generate an answer right now and I get the "Not enough input arguments" error. Then when I tried in the command window "F_theta(0)" I get "Undefined function 'F_theta' for input arguments of type 'double'." Any help would be appreciated, thanks.
function F_theta=Matlab_assignment_3(theta)
WPanel=[0, 20*9.8, 0];
That=[(.2-.2*sind(theta)),(.1+.2*cosd(theta)),-.125]/(sqrt((.2-.2*sind(theta))^2+(.1+.2*cosd(theta))^2+(-.125)^2));
Tmag=9.8*m;
T=That*Tmag;
rgb=[.1*sind(theta),-.1*cosd(theta),.125];
rcb=[.2*sind(theta),-.2*cosd(theta),.125];
rab=[0,0,.25];
MW=cross(rgb,WPanel);
MT=cross(rcb,T);
MAx=cross(rab,[1,0,0]);
MAy=cross(rab,[0,1,0]);
MB=[MAx' MAy' MT' MW'];
A_MB=rref(MB);
F_theta=A_MB(0,90);
Edit: Okay, so I think I'm approaching the variable situation all wrong, so I have two variables, m and theta, and my hopes is to have an equation that solves for m in terms of theta (for a range of theta that I can then plot). Should I be using system variables instead?
댓글 수: 0
답변 (2개)
Azzi Abdelmalek
2013년 5월 4일
편집: Azzi Abdelmalek
2013년 5월 4일
You should use
Matlab_assignment_3(0)
Your function is called Matlab_assignment_3
댓글 수: 0
Image Analyst
2013년 5월 4일
You need to call Matlab_assignment_3 first, with some input arguments before you can do "F_theta(0)" in the command window. Actually that wouldn't even work because F_theta is not a function, it's an array so the first element is 1, not 0. You could try
% Define some input angle.
theta = 45;
% Call the function and get F_theta in return.
F_theta=Matlab_assignment_3(theta)
% Display first element in command window.
F_theta(1)
댓글 수: 0
이 질문은 마감되었습니다.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!