MATLAB - Solving equations

  • Thread starter GreenPrint
  • Start date
  • #1
1,196
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:

Answers and Replies

  • #2
uart
Science Advisor
2,776
9
Why don't you just rearrange that equation (manually) to make T the subject of the formula?
 

Related Threads on MATLAB - Solving equations

  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
8
Views
6K
Replies
1
Views
1K
  • Last Post
Replies
3
Views
3K
  • Last Post
Replies
1
Views
2K
Replies
0
Views
5K
  • Last Post
Replies
6
Views
583
  • Last Post
Replies
2
Views
530
Top