MATLAB: Using solve to find solution of system of equations

equationMATLABsolvesymbolic

I am trying to find solutions to a system of equations, but I get a 1×1 sim for both t and angle_rad, and converting them using double(t) and double(angle_rad) respectively results in "Conversion to double from struct is not possible." All values used in the calculation are defined as numbers.
Thanks, Luca
syms t angle_rad
eq1 = df == vi*cos(angle_rad)*t-(0.5*(drag_coefficient*area_arrow*(density_air*vi^2)/2)*t^2);
eq2 = hf == hi+vi*sin(angle_rad)*t-(0.5*(g+(drag_coefficient*area_arrow*(density_air*vi^2)/2))*t^2);
sol = solve([eq1,eq2],[angle_rad,t]);

Best Answer

syms t angle_rad
eq1 = df == vi*cos(angle_rad)*t-(0.5*(drag_coefficient*area_arrow*(density_air*vi^2)/2)*t^2);
eq2 = hf == hi+vi*sin(angle_rad)*t-(0.5*(g+(drag_coefficient*area_arrow*(density_air*vi^2)/2))*t^2);
[angle_rad,t] = solve([eq1,eq2],[angle_rad,t])