Matlab assignment 1

# Matlab assignment 1 - Dang 1 Anna Dang PID: A09192411 Math...

This preview shows pages 1–4. Sign up to view the full content.

Dang 1 Anna Dang PID: A09192411 Math 20D Professor: Bin Dong TA’s name: Zezhon Zhang (section: A01) Mathlab Assignment 1 Exercise1.1: Code: a = log (20) b = log (8) c= a/b Input: >> a = log (20) >> b = log (8) >> c=a/b Output: a = 2.9957 b =

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Dang 2 2.0794 c = 1.4406 Exercise1.2 Code: m = -3:0.4:12 Input: >> m = -3:0.4:12 >> m = -3:0.4:12; >> m(26) Comment: Mathlab would automatically generate an excessive output if we do not enter the right mathematics equation, which is mathlab would identify. Exercise1.3 Code: z = 25 - (100 - 7exp(5+cos(pi/3)) Input: Wrong operation: >> z = 25 - (100 - 7exp(5+cos(pi/3)) Corrected operation: >> z = 25 - (100 - 7*exp(5+cos(pi/3)))
Dang 3 Output: Wrong operation: ??? z = 25 - (100 - 7exp(5+cos(pi/3)) Error: Unexpected MATLAB operator. Corrected operation: z = 1.6378e+003 Comment: Used up arrow key to bring back the line that is incorrect. Used the right and left arrow keys to check and correct the errors.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 12/13/2010 for the course MATH 20D taught by Professor Mohanty during the Spring '06 term at UCSD.

### Page1 / 12

Matlab assignment 1 - Dang 1 Anna Dang PID: A09192411 Math...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online