# MATLAB Problem

• Jan 19th 2009, 04:50 PM
ur5pointos2slo
MATLAB Problem
I need a little help please..

Using the ideal gas law solved for v. v= RT/P

Find the specific volume for air, for temperatures from 100 to 1000 K and for pressures from 100 kPa to 1000 kPa. The value of R for air is 0.2870 kJ/(kg K). Your answer should be a 2 dimensional matrix.

How would I go about applying the formula and the values of pressure and temperatures and air and make that a 2 dimensional matrix? Any help would be appreciated.
• Jan 19th 2009, 09:40 PM
Constatine11
Quote:

Originally Posted by ur5pointos2slo
I need a little help please..

Using the ideal gas law solved for v. v= RT/P

Find the specific volume for air, for temperatures from 100 to 1000 K and for pressures from 100 kPa to 1000 kPa. The value of R for air is 0.2870 kJ/(kg K). Your answer should be a 2 dimensional matrix.

How would I go about applying the formula and the values of pressure and temperatures and air and make that a 2 dimensional matrix? Any help would be appreciated.

Im not going to check that the units are right, so you will have to do that yourself:

Code:

```T=[100:10:1000]'; P=[100:10:1000]; R=0.2870; PP=1./P;   v=R.*(T*PP);```
with each row containing the values for each pressure corresponding to a given temprature.

.

[/code]
• Jan 20th 2009, 06:42 AM
ur5pointos2slo
Quote:

Originally Posted by Constatine11
Im not going to check that the units are right, so you will have to do that yourself:

Code:

```T=[100:10:1000]'; P=[100:10:1000]; R=0.2870; PP=1./P;   v=R.*(T*PP);```
with each row containing the values for each pressure corresponding to a given temprature.

.

[/code]

This is similar to what I was trying. Thank you