Plotting two continuous figures

5 views (last 30 days)
Adrian Quesada
Adrian Quesada on 2 Nov 2017
Commented: Rik on 2 Nov 2017
Hi I need to make two graphs in one figure. I have to plot the current vrs the voltage, for this I use the following command:
voltage= [-8:0.5:10];
r=200;
current=voltage/r;
plot (voltage,current)
In the next figure I have to plot the change in the current as a function of the resistance, but the starting point of this graph must be the end of the previous one. I calculate a new vector of the current as following:
v=10;
rn=[200:-0.5:0];
in=v./rn;
The complete figure should be similar to the enclosed one, so I have to reverse the x axis in the second graph.
How could I make the two graphs in one?
Thanks
  1 Comment
Rik
Rik on 2 Nov 2017
Be careful about the names you give things. A figure has a specific meaning in Matlab, which doesn't sound like what you are describing.
You know about hold on? You can use that to call plot again without it cleaning the axis.

Sign in to comment.

Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!