I think I have a simple problme. I have 4 plots in my code as you can see, however, it seems that Legend does not recognize my last plot.
Screen Shot 2019-01-25 at 8.13.51 PM.png

2 Comments

show your legend and plot calls
Here is my code:
I = 0:0.001:0.1;
R1 = 95.7;
R2 = 198.33;
V1 = I * R1;
V2 = I * R2;
V3 = 0:1:14;
plot(I,V1,'-k')
hold on
plot(I,V2,'-g')
plot(I,12,'-rx')
plot(0.1,V3,'-bo')
hold off
title('Voltage and Current')
legend('V(R1)','V(R2)','Voltage limit','current limit');
xlabel('Current DC (A)')
ylabel('Volatge DC (V)')

Sign in to comment.

 Accepted Answer

plot(I,repmat(12,1,numel(I)),'-rx')
plot(repmat(0.1,1,numel(V3)),V3,'-bo')

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!