HW4 #2 - disp(T1) %display table % x has 15 equally spaced...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 %Engineering 6, Spring 2004, Problem 4.2 %Ryan Uy, 2509 %Section B05, Tues. 3-4 % x equals 1 to for at intervals of 0.25 x = 1:0.25:4 % set vector arrays for x^2, sqrt(x), log(x), and ln(x) x_sqrd = x.^2 x_sqrt = sqrt(x) x_log = log10(x) x_ln = log(x) % create T1 by transposing the vector arrays and putting them in T1 = [ x' x_sqrd' x_sqrt' x_log' x_ln'] % display statements disp(' ') %newline disp(' x square of x sq root of x log(x) ln(x)') %headings
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: disp(T1) %display table % x has 15 equally spaced values from 10 to 30 x = linspace(10,30,15) % set vector arrays for x^2, sqrt(x), log(x), and ln(x) x_sqrd = x.^2 x_sqrt = sqrt(x) x_log = log10(x) x_ln = log(x) % create T2 by transposing the vector arrays and putting them in T2 = [ x' x_sqrd' x_sqrt' x_log' x_ln'] % display statements disp(' x square of x sq root of x log(x) ln(x)') %headings disp(T2) %display table...
View Full Document

This note was uploaded on 01/22/2011 for the course ENG 006 taught by Professor Lagerstrom during the Spring '06 term at UC Davis.

Ask a homework question - tutors are online