How Can MATLAB Automatically Solve and Apply Values in Equations?

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 3K views
GreenPrint
Messages
1,186
Reaction score
0
SOLVED

Homework Statement



Hello,

I was wondering if someone could please tell what functions are required to solve this problem. I was trying to solve P*v = 1*8.314*T for T were P=[2494 1247 831 623 499 416]; and v=1:6; I was trying to come up with a series of commands that would compute the value of T and plug in the first value of P and the 1st value of v then go on to the second values, third values, fourth values... Is there any way this is possible? Note that I know how to solve the equation for T by myself but I was wondering if there was anyway I could get MATLAB to do it for me and then plug in the values on it's on and present the 6 values of temperature

Please let me know if this makes no sense, I hope it does

Code:
disp('(a)')
v=1:6;
P=[2494 1247 831 623 499 416];
temperature= @(v,P) solve('1*8.314*T-P*v','T');
temperature(v,P)

I was trying to do something like that but that obviously wouldn't work becuase solve('1*8.314*T-P*v','T'); is symbolic and I can't set it to an anonymous function and then plug in the v and P values

Homework Equations


The Attempt at a Solution

 
Last edited:
Physics news on Phys.org