You can use the subplot()
function to create two separate subplots and plot each function on them. Here's an example code snippet:
main.m203 chars16 lines
The subplot()
function takes three arguments: the number of rows, number of columns, and the index of the subplot you want to create. In this case, we want to create two rows and one column of subplots, so we pass 2
and 1
as the first two arguments respectively. The first subplot is created by passing 1
as the third argument, and the second subplot is created by passing 2
as the third argument.
The plot()
function is used to plot the two functions y1
and y2
on separate subplots.
gistlibby LogSnag