MATLAB - Programming Excercise - 1 - and - 2
MATLAB - Programming Excercise - 1 - and - 2
1. Randomly generate seven integer numbers and count even and odd numbers among these
numbers and display this count.
2. Using while loop, find powers of 2 below 1000 and display each of them.
3. Enter a vector of positive and negative integers and sum first consecutive positive
numbers of this vector only and display this sum. (hint:Use break)
4. Enter a vector of positive and negative integers and sum all positive numbers of this
vector only and display this sum. (hint:Use continue)
5. Find factorial of inputted number n using recursion.
6. Using user defined function find the area and circumference of the circle whose radius is
inputted from the keyboard.
8. Using publish menu of MATLAB, generate a html file to show Polar plots of sin, cos.
9. Plot one cycle of sin(t) and put a text box and arrow to show sin(t)=.707 value on plot.
10. Take a text input from keyboard and put it on empty plot wherever the user clicks on this
empty plot. (hint: Use ginput() )
11. Input radius of circle using keboard and show menu where user can choose to draw these
plots: Cartesian, polar, stem
12. Write a Matlab script file to generate a Fahrenheit-Celsius temperature table for the
temperature in the range of -40 to 100 degree Fahrenheit in the step
of 5. Store the table in a file named 'Temperature.txt'.