Hi, I am new to matlab and i want to generate a voltage sag signal using m-file using the following equation

3 ビュー (過去 30 日間)
Appy18
Appy18 2014 年 11 月 13 日
コメント済み: Appy18 2014 年 11 月 15 日
x(t)=A(1a(u(tt1)u(tt2)));
where
0.1 a ≤ 0.9(depth of voltage sag)
T ≤ t2 − t1 ≤ 8T(T is the period)
t1 <t2(moment of the sag starting and ending)
u(t)=1 for all t0(unit stp function)
I just tried the following command but i didn't get it. It showed error
t=0:0.0001:2;
f=2;
A=1.0;
W=2*pi*f;
x=A*sin(W.*t);
u=inline('t>=0');
a=0.6; t1=12; t2=24;
x1= (1-a(u(t-t1)-u(t-t2))).*x;
subplot(3,1,1)
plot(t,x1)
title('Voltage sag');
xlabel('time--->');
ylabel('Amplitude--->');
so pls. help me.
Thank you in advance

回答 (1 件)

MA
MA 2014 年 11 月 13 日
t=0:0.0001:2;
f=2;
A=1.0;
W=2*pi*f;
x=A*sin(W.*t);
u=inline('t>=0');
a=0.6; t1=12; t2=24;
x1= (1-a*(u(t-t1)-u(t-t2))).*x;
plot(t,x1)
title('Voltage sag');
xlabel('time--->');
ylabel('Amplitude--->');
  3 件のコメント
MA
MA 2014 年 11 月 13 日
you're welcome... please click on the accept answer button if you get your answer

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by