One problem is that there needs to be a multiplication operator between ‘30’ and ‘exp(6)’.
The other problem is that the data need to be separated into thier individual components to be evaluated in ‘deflection_Hilderbrandt’ however where this is done is simply a mater of code design. (I did it in the calling script here.)
If the rest of the code is correect, thiw works and produces the correct result —
v={(5/2) 5 3 30*exp(6) (16/625) 30};
[x,L,a,E,I,P] = v{:}
[V]=deflection_Hilderbrandt(x,L,a,E,I,P);
V
function [V]=deflection_Hilderbrandt(x,L,a,E,I,P)
b=L-a
if 0<=x && a>=x
V=((P*b/(6*E*I*L))*(-L^(2)+b^(2))*x+x^(3))
else a<x && L>=x
V=((P*b/(6*E*I*L))*(-L^(2)+b^(2))*x+x^(3)-(L/b)*(x-a)^(3))
end
fprintf('The value of vertical deflection V is %f \n')
end
.