Issues with Matrix Multiplication
1 回表示 (過去 30 日間)
古いコメントを表示
Hi all. I have a script for calculating the current flowing through a diode at 3 different temperatures. I am having problems with the division of 2 matrices found in the exponent of the equation. The equation is of course correct, mathematically sound etc. I have done the usual checks etc with matrix operations, but what it comes down to is that I'm trying to divide a 1x17 array (v_D in the code) by a 3x1 (T' in the code) array. The code can be found below. Any answers/help is greatly appreciated!
q=1.602e-19; k=1.38e-23; I0=2.0e-6; v_D=-1.0:0.1:0.6; T=[23.89 37.78 51.67]';
for ii=1:length(T)
i_D=I0.*(exp((q*v_D)./(k*T))-1);
if ii==1
plot(v_D,i_D,'r','LineWidth',2)
hold on
elseif ii==2
plot(v_D,i_D,'b','LineWidth',2)
elseif ii==3
plot(v_D,i_D,'k','LineWidth',2)
hold off
end
end
legend('T=23.89 deg C','T=37.78 deg C','T=51.67 deg C'),grid on,
xlabel('\bt\itv'),ylabel('\bf\iti (v)'),
title('\bf\itA Plot of Current as a Function of the Applied Voltage Across a Diode')
採用された回答
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Sources についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!