필터 지우기
필터 지우기

to fix plotting code

조회 수: 2 (최근 30일)
sevgul demir
sevgul demir 2021년 12월 8일
댓글: sevgul demir 2021년 12월 8일
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
sevgul demir
sevgul demir 2021년 12월 8일
omg i'm little embarrassed thank you ^^

댓글을 달려면 로그인하십시오.

채택된 답변

KSSV
KSSV 2021년 12월 8일
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')

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Fit Postprocessing에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by