필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
Awesome
Awesome 2022년 11월 13일
답변: Harshit Gupta 2022년 11월 16일
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