how to change basic signal of rectangular funtion to laplace transform

2 ビュー (過去 30 日間)
Mya
Mya 2022 年 1 月 31 日
コメント済み: Mya 2022 年 1 月 31 日
fprintf('Please choose any type of signal below.\n1. Impulse\n2. Step function\n3. DC Source\n4. Signum function\n5. Rising exponent function\n6. Cosine function\n7. Sine function\n8. Square function\n9. Triangular function\n10. Symmetrical decaying exponent function')
s = input('\nSignal number: ');
switch(s)
case 8
t =-3:0.01:5;
c=input('amplitude:');
A = input('Amplitude scale value:');
B = input('Amplitude shift value: ');
a = input('Time scale value: ');
b = input('Time shift value: ');
y=c*((t>=-1)&(t<=1));
figtitle ='rectangular pulse';
subplot(3,1,1)
plot(t,y,'b')
hold on
plot((t./a)+b,A*y+B,'r')
hold off
title(figtitle)
xlabel('Time')
ylabel('Amplitude')
grid on
% adjust limits to create padding
xlim(xlim + [-2 1]*1.2)
ylim(ylim + [-2 1]*1.2)
subplot (3,1,2)
x = -3:0.01:3;
d = c.*sinc((x*2)./2);
plot(x, d)
ylim([-c-2 c+2])
grid on
title('fourier transform');
ylabel('F(w)');
xlabel('w');
%how to subplot laplace transform of rectangular function
  3 件のコメント
Walter Roberson
Walter Roberson 2022 年 1 月 31 日
After you do the laplace(), use subs() to replace the start and end positions and height with specific values, leaving t as symbolic. Then fplot() the results, making sure to pass in the bounds you want to plot over.
Mya
Mya 2022 年 1 月 31 日
ouh alrite and tq for guiding me ;)

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

採用された回答

Walter Roberson
Walter Roberson 2022 年 1 月 31 日
syms pulse_height pulse_start pulse_end t positive
rectangular_pulse = pulse_height * rectangularPulse(pulse_start, pulse_end, t)
rectangular_pulse = 
%now let us work according to theory:
sympref('HeavisideAtOrigin', 1)
ans = 
RP = rewrite(rectangular_pulse, 'heaviside')
RP = 
LRP = laplace(RP)
LRP = 
%but actually we could just work directly on the rectangularPulse object
laplace(rectangular_pulse)
ans = 

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by