1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: MATLAB - Solving equations

  1. Jul 15, 2011 #1

    1. The problem statement, all variables and given/known data


    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 (Text):
    P=[2494 1247 831 623 499 416];
    temperature= @(v,P) solve('1*8.314*T-P*v','T');
    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

    2. Relevant equations

    3. The attempt at a solution
    Last edited: Jul 16, 2011
  2. jcsd
  3. Jul 16, 2011 #2


    User Avatar
    Science Advisor

    Why don't you just rearrange that equation (manually) to make T the subject of the formula?
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook