r2_yun - d=logspace(1,3,4) %% problem 3 x = linspace(0.988,...

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

View Full Document Right Arrow Icon
Recitation         40mins 40mins Practice Exercises 2.3 Page 23 2.3 2.6 2.10 2 3 40mins 40mins Practice Exercises 2.4 Page 30 2.8 2.12 2.17 Please save your work as yourname_rec1.m and upload it on sakai-> Dropbox
Background image of page 1

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

View Full DocumentRight Arrow Icon
What does a.*b mean? a = [1 2 3 4]; % row vector b = [5 6 7 8]; a .* b = [5 12 21 32] % . means element by element % use . before * / \ ^
Background image of page 2
What does a.*b mean? 1 2 3 4 5 6 7 8 9 a = 2 4 6 1 3 5 3 2 1 b = 1*2 2*4 3*6 .* 4*1 5*3 6*5 7*3 8*2 9*1 a b =
Background image of page 3

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

View Full DocumentRight Arrow Icon
What does a.^2 mean? a = [1 2 3 4]; % row vector a .^ 2 = [1 4 9 16];
Background image of page 4
triangle circle sphere cylinder
Background image of page 5

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

View Full DocumentRight Arrow Icon
%% Problem 2.6 % a) Volume r=10; length=15; d=1; volume_sphere=4/3*pi*r^3; volume_bar=pi*(d/2)^2*length; total_volume=2*volume_sphere +volume_bar % b) Surface Area sa_sphere=4*pi*r^2; sa_bar=pi*d*length; total_sa=2*sa_sphere + sa_bar %% Problem 2.10 a=1:20 b=0:pi/10:2*pi c=linspace(4,20,15)
Background image of page 6
Background image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: d=logspace(1,3,4) %% problem 3 x = linspace(0.988, 1.012, 241); y1 = x.^7 - 7*x.^6 + 21*x.^5 - 35*x.^4 + 35*x.^3 - 21*x.^2 + 7*x - 1; y2 = (x-1).^7; plot(x,y1,'b', x,y2,'r'); %% Practice Exercise 2.4 a=[2.3 5.8 9] sin(a) a+3 b=[5.2 3.14 2] a+b a.*b a.^2 c=0:10 d=0:2:10 linspace(10,20,6) logspace(1,2,5) %% Problem 2.12 g=9.8; t=0:10:100; d=1/2*g*t.^2; table=[t',d'] %% Problem 2.8 % a) r=3; h=[1,5,12]; volume = pi*r^2.*h % use the .* operator since h is an array % b) b=[ 2, 4, 6]; h=12; area=1/2*b.*h area=1./2.*b.*h % both works % c) h=6; volume=h.*area %% Problem 2.17 D=0:10:180; R=D*pi/180; D_to_R=[D',R'] save degrees.dat -ascii D_to_R %Check your current directory to confirm that the file was saved clear load degrees.dat degrees...
View Full Document

This document was uploaded on 11/04/2011 for the course ENGINEERIN 440 at Rutgers.

Page1 / 7

r2_yun - d=logspace(1,3,4) %% problem 3 x = linspace(0.988,...

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

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