input and output arguments in a function file
이전 댓글 표시
I have written a function file to give deflection (w) after a number of variables are inputted into a formula. my code is:
if true
% code
end
function w=function_project2[v t rd E p K]
%Function to find w (deflection)
% Input variables:
%v=poissons number
%t=plate thickness measured in metres
%rd=Radius of metal plate
%E=Young's modulus for selected material
%P=Pressure in kN
%K=Constant
%r=radial coordinate
%Output: variables
%w=deflection
w=(P*rd^4)/(64*K*(1+v)*(2*(3+v)*(1-(r/rd)^2)-(1+v)*(1-(r/rd)^4));
wmax=(P*rd^4*(5+v))/(64*K*(1=v)) end
The error coming up reads: function w=function_project2[v t rd E P K] | Error: Function definitions are not permitted in this context.
>>
1 Should my input variables and their values be listed in the function instead of the script file? 2 Have I completely misunderstood the input and output argument system? 3 pressure (p) has not yet been defined in the script or function. i am looking for it to increase in steps of 5000N until wmax is reached. How do i go about putting this into the formula? for loops?
Thanks, Mike
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Whos에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!