Solution1

Solution1 - Solutions ChE132B HW1 20pt Problem 1 part (a)...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Solutions ChE132B HW1 20pt Problem 1 part (a) 3pt The values of pi, i, and j are 3.14159…, , and , respectively as shown by the MATLAB Input/Output below: >> pi ans = 3.1416 >> i ans = 0 + 1.0000i >> j ans = 0 + 1.0000i If any of these constants, pi, i, or j are redefined in the Command Window, then their value is whatever has been assigned. However, even if their values have been redefined in the Command Window, their values remain 3.14159…, , and , respectively, in an M-file so that you do not have to worry about the M- file not working as designed because one or more of the constants pi, i, or j have been redefined in the Command Window. You can demonstrate this by running the following M-file (test.m) after you have redefined any or all of the constants, pi, i, or j: function[]=test() x=pi y=i z=j
Background image of page 1

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

View Full DocumentRight Arrow Icon
>> test() x = 3.1416 y = 0 + 1.0000i z = 0 + 1.0000i Part (b) 3pt MATLAB Input/Output from Command Window >> log(10) ans = 2.3026 >> log2(10) ans = 3.3219 >> log(-1) ans = 0 + 3.1416i
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/12/2012 for the course CHE 132b taught by Professor Ceweb during the Fall '09 term at UCSB.

Page1 / 7

Solution1 - Solutions ChE132B HW1 20pt Problem 1 part (a)...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online