Please this code says Error using plot. Vectors must be the same length. Error in untitled2 (line 8) plot(I,V,'0');
1 次查看(过去 30 天)
显示 更早的评论
clear all; close all; clc;
%%VCE vs. IC (Fig.3, 125oC, VGE=15V)
I=[10 20 30 30 40 50 60 70 80 90 100];
V=[1.5 1.9 2.2 2.5 2.77 3 3.25 3.5 3.72 3.95];
plot(I,V,'o');
x=10:100;
y=-7.9167*10^(-5)*x.^2 + 0.035236*x + 1.1958;
plot(I,V,'o',x,y);
%%Conduction Loss Calculation
Tj= 125; fsw=20000;
a=-7.9167*10^(-5);b=0.035236; c=1.1958;
I=40; M=0.5;
syms theta;
i=0;
j=0;
for M=0.2:0.05:0.8
j=j+i;
duty=0.5*0.5*M*sin(theta);
i=0;
for I=10:5:100
i=i+1;
F_cond=I*sin(theta)*(a*(I*sin(theta))^2+b*I*sin(theta)+c);
Cal_cond_loss(i,j)=double(int(duty*F_cond,theta,0,pi))/(2* pi);
end
end
surf(Cal_cond_loss); hold on; colorbar('Eastoutside');
axis([1 j 1 i 0 100]);
set(gca, 'XTick',1:4:13);
set(gca, 'YTick',1:6:19);
0 个评论
采纳的回答
VBBV
2022-11-7
I=[10 20 30 30 40 50 60 70 80 90 100];
V=[1.5 1.9 2.2 2.5 2.77 3 3.25 3.5 3.72 3.95 4]; % this vector has less number of elements
V has only 10 elements
i=0;
j=0;
for M=0.2:0.05:0.8
j=j+1; % change it to 1 and try
更多回答(2 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Get Started with Symbolic Math Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!