to fix plotting code

1 visualización (últimos 30 días)
sevgul demir
sevgul demir el 8 de Dic. de 2021
Comentada: sevgul demir el 8 de Dic. de 2021
diary ex9_1.dat
% Diode parameters
vt = 25.67e-3;
v = [0.1 0.2 0.3 0.4 0.5 0.6 0.7];
i = [0.133e-12 1.79e-12 24.02e-12 321.66e-12 4.31e-9 57.69e-9 772.58e-9];
%
lni = log(i); % Natural log of current
% Coefficients of Best fit linear model is obtained
p_fit = polyfit(v,lni,1);
% linear equation is y = m*x + b
b = p_fit(2);
m = p_fit(1);
ifit = m*v + b;
% Calculate Is and n
Is = exp(b)
n = 1/(m*vt)
% Plot v versus ln(i), and best fit linear model
plot(v,ifit,'w', v, lni,'ow')
axis([0,0.8,-35,-10])
xlabel('Voltage (V)')
ylabel('ln(i)')
title('Best fit linear model')
diary
even i try to run it, does not show anything... i am gonna upload the result what i am getting
dont know what's the problemm
  1 comentario
sevgul demir
sevgul demir el 8 de Dic. de 2021
omg i'm little embarrassed thank you ^^

Iniciar sesión para comentar.

Respuesta aceptada

KSSV
KSSV el 8 de Dic. de 2021
You are using white color to plot, so the plots are not visible.
Change the line:
plot(v,ifit,'w', v, lni,'ow') % Change the color w to someother
to:
plot(v,ifit,'r', v, lni,'or')

Más respuestas (0)

Categorías

Más información sobre Fit Postprocessing en Help Center y File Exchange.

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by