MATLAB Answers

subplot of trigonometric function

23 views (last 30 days)
Yung Xi
Yung Xi on 24 Oct 2019
Commented: Steven Lord on 24 Oct 2019
I want to make a 3x1 subplot (1 column and 3 row) for 3 trigonometric graphs
y = sin(x)
y= cos(x)
y = tan(x)
for x = 1:0.1:50
What code to do this? Thank you.


Sign in to comment.

Answers (1)

Stephan on 24 Oct 2019
A = @(x) sin(x);
fplot(A,[1 50])
B = @(x) cos(x);
fplot(B,[1 50])
C = @(x) tan(x);
fplot(C,[1 50])


Yung Xi
Yung Xi on 24 Oct 2019
Thank you. What code I use to change title for each graph, axis label, and line color?
Steven Lord
Steven Lord on 24 Oct 2019
The Formatting and Annotation chapter in the documentation describes functions, tools, and techniques you can use to customize the appearance of your plots.

Sign in to comment.


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by