MATLAB: How do i convert V=pi*h^2*[3R-h]/3 equation into a function. I have V and R and need to find h

equationsfunctions

ver

Best Answer

"How do i convert V=pi*h^2*[3R-h]/3 equation into a function. I have V and R and need to find h"
V=4;
R=3;
h = height(V,R) %function call
function h = height(V,R) %function definition just create a functin with V and R as input
syms h
h=vpasolve(V==pi*h^2*3*(R-h)/3,h);
end