Skip to content

Instantly share code, notes, and snippets.

Created February 9, 2014 19:49
Show Gist options
  • Save anonymous/8904953 to your computer and use it in GitHub Desktop.
Save anonymous/8904953 to your computer and use it in GitHub Desktop.
Pattern: Graph y(x) for different ranges of a
%Graph f(x) for different ranges of a:
fun = @(x,a) a(1):1/floor(length(x)/(length(a)-1)):a(end);
dx=1/100;
x=0.1:dx:10;
a1=-1:1;
a1range=fun(x,a1); %make the number of clips of a match the number
%of clips of x
a2=-10:0;
a2range=fun(x,a2);
y1=exp(a1range.*sqrt(x));
plot(x,y1);
title('plots of exp(a*sqrt(x))');
xlabel('x');
ylabel('y');
hold on;
y2=exp(a2range.*sqrt(x));
plot(x,y2);
hold off;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment