Академический Документы
Профессиональный Документы
Культура Документы
(AMEN)
09/04/2020
Conditional and Loop control statements
switch switch_expression
case case_expression
statements
case case_expression
statements
otherwise
statements
end
▪ The switch block tests each case until one of the case
expressions is true
statements
end
▪ Write a MATLAB functions using for loop and while loop to calculate
the factorial of a number
𝑦−𝑦0 𝑦1 −𝑦0
=
𝑥−𝑥0 𝑥1 −𝑥0
▪ Write functions to vary Theta and R from 0-90 degrees and 1-2.5 m
respectively (n discretisation points for Theta and m discretisation points for
R) and calculate the value of omega at each data points to form a n x m
matrix. First with ‘for’ loops and second only with vector operations. Use
n=11 and m=16
▪ Calculate hence, the Omega values for (30,2); (55.7,1.4); (78.34,2.28). (Use
separate functions to perform 2D linear interpolation for the Omega values
not calculated using the discretisation).
▪ Plot the Omega results in a 2D graph varying radius in the X-axis for
selected 5 points of theta (27,36,45,54,63)
▪ Vary Values of A1 and A2 in the expression for outlet pressure of the nozzles
and plot graphs. (The graph should be descriptive, everything else is
individual choice)
▪ https://www.mathworks.com/help/matlab/index.html
▪ https://ocw.mit.edu/courses/mechanical-engineering/2-25-advanced-
fluid-mechanics-fall-2013/control-volume-theorems-and-
applications/MIT2_25F13_Shapi5.29_Solut.pdf