Hi all, I want to plot an i-v curve of this equation i=100*[1.3-v+500*(5-i)]^2 by using Matlab, but unfortunately it looks that the plot I get isn’t the one that I want, so I think there must be something wrong but I don’t know it. Your suggestions and comments will be highly appreciated!
Here is my code:
%current versus voltage curve
v=0:0.1:3;
i=100*[1.3-v+500*(5-i)].^2;
plot(v,i)
title('current versus voltage of 2.6(c)')
xlabel('Voltage(V)')
ylabel('Current(uA)')
grid
The problem here is from the fact that you have i in the right and left side of the equation, so you cant use the expressions in the way you did, what is the first value of i here? Haow can matlab guess the i in the right side? you just dont have it ! so the graphic is not what you expected.
You must do a for loop giving i a initial value calculate i recursevily then buid the two vectors i and v afterwards you can plot v x i graphic