Skip to content

Instantly share code, notes, and snippets.

@dingzeyuli
Created October 28, 2016 22:02
Show Gist options
  • Save dingzeyuli/786bce64b8a174ba7c99ecad90cb578d to your computer and use it in GitHub Desktop.
Save dingzeyuli/786bce64b8a174ba7c99ecad90cb578d to your computer and use it in GitHub Desktop.
lin = @(x) x;
sqr = @(x) x.^2;
cub = @(x) x.^3;
x = -pi/2:pi/1000:pi/2;
y1 = atan(lin(tan(x)));
y2 = atan(sqr(tan(x)));
y3 = atan(cub(tan(x)));
figure
hold on
plot(x, y1)
plot(x, y2)
plot(x, y3)
legend('y=x','y=x^2','y=x^3')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment