please I am getting this error at line 7 Error in code1 (line 7) plot(I, sw_total,'o');

3 次查看(过去 30 天)
clear all; close all; clc;
%%Switching Energy Loss vs Collector Current( Fig.13,125oC
sw_on=[0 3.4 4.5 5.55 6.6 7.45 8.05 8.65]*0.001;%mJ
sw_off=[0 1.85 2.1 2.38 2.75 3.2 3.78 4.38]*0.001;%mJ
sw_total=sw_on+sw_off; %mJ
plot(I, sw_total,'o');
x=0:100;
y= -4.2885*10^(-8)*x.^2 + 0.00013567*x -3.0661*10^(-5);
plot(I,sw_total,'ro',x,y);
%%Switching Loss Calculation
Tj= 125;
Vbase=600; Vdc=600;
a=-4.2885*10^(-8);b=0.00013567; c=3.0661*10^(-5);
syms theta;
i=0;
j=0;
for fsw=10000:2000:30000
j=j+1;
i=0;
for I=10:5:100
i=i+1;
F_sw= a*(I*sin(theta))^2 + b*I*sin(theta)+ c;
Cal_sw_loss(i,j) = double((Vdc/(Vbase*2*pi)) *int(F_sw,theta, O, pi)*fsw);
end
end
surf(Cal_sw_loss); hold on; colorbar('Eastoutside');
axis([1 j 1 i 0 100]);
set(gca, 'XTick',1:5:11);
set(gca, 'YTick',1:6:19);
set(gca, 'YTick',0:20:140);
  3 个评论
Awesome
Awesome 2022-11-13
Warning: Imaginary parts of complex X and/or Y arguments ignored.
> In code1 (line 7)
Warning: Imaginary parts of complex X and/or Y arguments ignored.
> In code1 (line 10)
I am getting this error after.
Torsten
Torsten 2022-11-13
编辑:Torsten 2022-11-13
I don't know how you set "I" in your modified code - so I cannot comment on this.

请先登录,再进行评论。

回答(1 个)

Harshit Gupta
Harshit Gupta 2022-11-16
As per my understanding, the initial error that you were facing has been resolved by following @Torsten's inputs. And now you are getting the following warning: (I am assuming that you have defined the variable "I", and then you are getting this warning)
Warning: Imaginary parts of complex X and/or Y arguments ignored.
Please refer to the below MATLAB Answers link to resolve this warning:

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by