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

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

View Full Document Right Arrow Icon
6-A.14 function 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 plot x = 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.17 function 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_17 figure % generate plot 1 in a subplot subplot(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 on title( '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 subplot subplot(3,1,2) x = 0.8; y = linspace(2,4); z = 3; G = (z*exp(-0.3/x)) ./ (log(y)*sqrt(x));
Image of page 1

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

View Full Document Right Arrow Icon
plot(y, G, '-g'), grid on xlabel('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 subplot subplot(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 on xlabel('z') ylabel('G') disp('move cursor to graph to put label for constants') gtext('x = 0.8'), gtext('y = 5')
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern