MATLAB homework

profileavvhatgihasad
matlab_homework1_2016.pdf

MATLAB Homework #1

Assigned Monday Oct. 17

Due: Monday Oct. 31 Use MATLAB to complete the following assignments At the beginning of the problem write a brief (1-2 sentence) summary of what the program does. Use (%) to make these into comments in your program. Continue to use comments throughout your code to document what each section of the program is doing.

1) What is the product of all numbers from 1 to 20 (1*2*3*4 etc)? What happens if you try to find the produce of all numbers from 1 to 100?

2) What is the product of all even numbers from 1 to 30?

3) Compute the values for the function e^x for x = 0:1:1000

a. Put these values into a matrix

b. Plot these values as e^x versus x

4) Write your own (short) program to solve a problem from another class or for your everyday life.