i got these values in matlab but im not sure if its right.Can you code this and
ID: 2085717 • Letter: I
Question
i got these values in matlab but im not sure if its right.Can you code this and if you understand it and/or if my outputs are correct let me know.Im using the program MATLAB to do this assigment.
temp_vector=logspace(0,3,6) %vector of 1 to 1000 lothrithmically space with 6 values each
preesure_vector=logspace(0,3,6) %vector of 1 to 1000 lothrithmically space with 6 values each
%R=0.2870 kJ/(kg K)
[temp_vector,preesure_vector] = meshgrid( temp_vector./preesure_vector) %meshgrid of temp,preesure vectors
temp_vector =
1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1
preesure_vector =
1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1
volume_of_meshgrid = R .* temp_vector ./ preesure_vector %gives volume of air for the meshgrid vector
volume_of_meshgrid =
0.2870 0.2870 0.2870 0.2870 0.2870 0.2870
0.2870 0.2870 0.2870 0.2870 0.2870 0.2870
0.2870 0.2870 0.2870 0.2870 0.2870 0.2870
0.2870 0.2870 0.2870 0.2870 0.2870 0.2870
0.2870 0.2870 0.2870 0.2870 0.2870 0.2870
0.2870 0.2870 0.2870 0.2870 0.2870 0.2870
Explanation / Answer
temp_vect = logspace(0,6,6);%10^0 to 10^6(1000k) with 6 values
pres_vect = logspace(3,6,6);%10^3(1kPa)to 10^6(1000k) with 6 values
R = 0.2870;%
[Temp_Vect_2D, Pres_Vect_2D]= meshgrid(temp_vect,pres_vect);%converts two 1D vectors into two 2D vectors
Volume1 = R*Temp_Vect_2D./Pres_Vect_2D;
Command window output;
>> Volume1
Volume1 =
0.0003 0.0045 0.0721 1.1426 18.1085 287.0000
0.0001 0.0011 0.0181 0.2870 4.5486 72.0911
0.0000 0.0003 0.0045 0.0721 1.1426 18.1085
0.0000 0.0001 0.0011 0.0181 0.2870 4.5486
0.0000 0.0000 0.0003 0.0045 0.0721 1.1426
0.0000 0.0000 0.0001 0.0011 0.0181 0.2870
>>
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.