Matlab returns the function only

user2511652
syms h v t g
g = 10;

eqn1 = h==(v.^2 * (sin(t)).^2)/2*g;

t=1;
v=10;

vpasolve(eqn1,h)

I want to solve this equation for values inside a matrix. but before that I wanted to test this if it is working correctly. however after the definition of eqn1, the values I assign to the variables v,t doesn't seem to get by when I use vpasolve. How do I do this?

ThP

You should use the function subs.
You have two options. You can simply do this:

t=1;
v=10;
vpasolve(subs(eqn1),h)

But I think the following is more readable and less prone to errors:

vpasolve(subs(eqn1,[t,v],[1,10]),h)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related