Unit8 Lab B - 6-A.14function Prob6_A_14(a b plots specified...

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: 6-A.14function Prob6_A_14(a, b)% plots specified math function in range (a, b)% INPUT: a, scalar, lower limit for range of function plot% b, scalar, upper limit for range of function plot% OUTPUT: none% generates a plotx = linspace(a,b);F = 1 ./ (x .* exp(-0.04./x));plot(x, F, '-k')title('F(x) = 1 / (x * exp(-0.04/x))', 'FontSize', 16)xlabel('x', 'FontSize', 12)ylabel('F(x)', 'FontSize', 12)grid on% sample call% lower = 1;% upper = 2;% Prob6_A_14(lower, upper)6-A.17function Prob6_A_17% plot G(x,y,z) = (z*exp(-0.3/x)) / (log(y)*sqrt(x))% as 2D plots,% PLOT 1: var x in (0.1,4), y=5, z=3% PLOT 2: var y in (2,4), x=0.8, z=3% PLOT 3: var z in (0,4), with x=0.8, y=5% INPUT: none% OUTPUT: none% generate a graph% sample call% Prob6_A_17figure% generate plot 1 in a subplotsubplot(3,1,1)x = linspace(0.1,4);y = 5;z = 3;G = (z*exp(-0.3./x)) ./ (log(y)*sqrt(x));plot(x, G, '-r'), grid ontitle( 'G(x,y,z) = (z*exp(-0.3/x)) / (log(y)*sqrt(x))', 'FontSize', 14)xlabel('x')ylabel('G')disp('move cursor to graph to put label for constants')gtext('y = 5'), gtext('z = 3')disp('DONE')% generate plot 2 in a subplotsubplot(3,1,2)x = 0.8;y = linspace(2,4);z = 3;G = (z*exp(-0.3/x)) ./ (log(y)*sqrt(x));plot(y, G, '-g'), grid onxlabel('y')ylabel('G')disp('move cursor to graph to put label for constants')gtext('x = 0.8'), gtext('z = 3')disp('DONE')% generate plot 3 in a subplotsubplot(3,1,3)x = 0.8;y = 5;z = linspace(0,4);G = (z*exp(-0.3/x)) / (log(y)*sqrt(x));plot(z, G, 'm'), grid onxlabel('z')ylabel('G')disp('move cursor to graph to put label for constants')...
View Full Document

This homework help was uploaded on 03/30/2008 for the course CSE 131 taught by Professor Sticklen during the Spring '08 term at Michigan State University.

Page1 / 5

Unit8 Lab B - 6-A.14function Prob6_A_14(a b plots specified...

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