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
endfunction 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
Best Answer