Can anybody help me solving this question with script file?
Mostrar comentarios más antiguos
Create a main script (program) that asks the user which expression to show and then draws the appropriate face by calling functions for most of the data. The switch structure can be used as part of this (it can be found in your textbook).
Hint: You will need to use the hold command to plot on one Figure. You must use at least one function in your program, mycircle.
[x y] = mycircle(x_center, y_center, radius)
The mycircle function returns the arrays of x and y values to be plotted. Your main program (script) then does the actual plotting. If you are clever you can modify the mycircle function with extra inputs so that it creates both arcs and circles. Arcs make nice eyebrows and smiling faces.
Any straight lines you need can be generated without using a function but by hard coding the points.
Remember the hold command we used on the tic-tac-toe board in recitation. Your program should show the following expressions:
- Happy
- Surprised
- Asleep
- A different emotion of your choosing
Respuestas (1)
Walter Roberson
el 26 de Mzo. de 2017
w = input('which expression to show', 's') ;
switch w
case 'stirlings formula' :
draw_stirlings() ;
end
Categorías
Más información sobre Animation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!