CH5scripts - tax = 0.1 * ti; elseif ti < 20000...

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

View Full Document Right Arrow Icon
% CH 5 Scripts hold on x = 0:pi/40:3*pi; y = sin(x); y = y .* (y > 0); axis([0 10 0 2]) plot(x, y) hold off x = -4*pi:pi/20:4*pi; x = x + (x == 0) * eps; y = sin(x) ./ x; plot(x, y) clf hold on subplot(2,2,1) x = -3/2*pi:pi/100:3/2*pi; y = tan(x); plot(x,y),title('(a)') y = y .* (abs(y) < 1e10); subplot(2,2,2) plot(x,y),title('(b)') hold off % % Example of tax computation on page 136 % inc = [5000 10000 15000 30000 50000]; for ti = inc if ti < 10000
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: tax = 0.1 * ti; elseif ti &lt; 20000 tax = 1000 + 0.2 * (ti - 10000); else tax = 3000 + 0.5 * (ti - 20000); end; disp( [ti tax] ) end; % % Example on page 136 % Income tax computation inc = [5000 10000 15000 30000 50000]; tax = 0.1 * inc .* (inc &lt;= 10000); tax = tax + (inc &gt; 10000 &amp; inc &lt;= 20000) . .. .* (0.2 * (inc-10000) + 1000); tax = tax + (inc &gt; 20000) .* (0.5 * (inc-20000) + 3000); disp( [inc' tax'] );...
View Full Document

This note was uploaded on 11/06/2011 for the course HANDOUT 502 at USC.

Page1 / 2

CH5scripts - tax = 0.1 * ti; elseif ti &amp;amp;lt; 20000...

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

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