Answer:
%Program prompts user to input vector
v = input('Enter the input vector: ');
%Program shows the value that user entered
fprintf('The input vector:\n ')
disp(v)
%Loop for checking all array elements
for i = 1 : length(v)
%check if the element is a positive number
if v(i) > 0
%double the element
v(i) = v(i) * 2;
%else the element is negative number.
else
%triple the element
v(i) = v(i) * 3;
end
end
%display the modified vector
fprintf('The modified vector:\n ')
disp(v)
Answer:
The speed of the sound for the adiabatic gas is 313 m/s
Explanation:
For adiabatic state gas, the speed of the sound c is calculated by the following expression:
Where R is the gas's particular constant defined in terms of Cp and Cv:
For particular values given:
The gamma undimensional constant is also expressed as a function of Cv and Cp:
And the variable T is the temperature in Kelvin. Thus for the known temperature:
The Jules unit can expressing by:
Replacing the new units for the speed of the sound:
