1

How do i plot a I-V graph given the following step size of V. the following equation:

%Given: Rs=0.5; V=0:1.5:35;

I=exp(V+RsI)+(V+RsI);

1 Answers1

0

If you just need the graph, you don't need to solve the equation, you can use ezplot to plot implicit equations.

If you need to solve it specifically over that range you can use fzero inside a for loop, BUT, I think you don't have your equation right, because it doesn't seem to be defined over that range

Noel Segura Meraz
  • 2,265
  • 1
  • 12
  • 17
  • thank you noel! btw, i have difficulty plotting it because the equation has 'I' on both sides of the equation. Please explain if there is a way to plot the equation. – user5850017 Jan 28 '16 at 07:28
  • Equation: I=exp(V+Rs*I)+(V+Rs*I); how to plot an I vs V graph from V=0:1.5:35; given Rs value of 0.5 – user5850017 Jan 28 '16 at 07:30
  • As I told you, you can use `ezplot` to get the plot, http://www.mathworks.com/help/matlab/ref/ezplot.html you just need to transform your equation to the form f(I,V)=0 – Noel Segura Meraz Jan 28 '16 at 07:32
  • oh you are right, the actual equation is here: http://stackoverflow.com/questions/35055747/plotting-of-graph-with-unknown-parameter-containing-exp please guide, i am still confuse with ezplot – user5850017 Jan 28 '16 at 08:01
  • Can you please tell me which part of `ezplot` is giving you problems? – Noel Segura Meraz Jan 28 '16 at 08:08
  • This is what i typed: Vv=0:1.5:35; ezplot('-Ii+7.5-1.1e-06*exp((Vv+0.3*Ii)/2)+(1.1e-06)-(Vv+0.3*Ii)/271=0'); 1) A graph of (y-axis) Vv vs (x-axis) Ii was shown, however i would like it to be Ii vs Vv graph. 2) There was no diagram on the graph. – user5850017 Jan 28 '16 at 08:16
  • Oh, I see, you need to define the plotting range, like `[xmin,xmax,ymin,ymax]`, in this case i would recomend `ezplot('your_long_function',[0,35,-10,10])` – Noel Segura Meraz Jan 28 '16 at 08:21
  • Thanks noel for sharing! However the x and y axis are still opp from what i would like, is there a way to swap the axes? – user5850017 Jan 28 '16 at 08:25
  • Oh yeah, that, ezplot assign them alphabetically, but behaves weirdly when two letters are used, you can change your variable names to V and I, and it should work. Or you can define the order with an anonymus function, like `ezplot(@(I,V)your_long_function_without_apostrophes , [Imin,Imax,Vmin,Vmax])` – Noel Segura Meraz Jan 28 '16 at 08:31
  • Glad I could help, please set your question as answered so it can be closed – Noel Segura Meraz Jan 28 '16 at 08:39