How do I create a Gaussian pulse for the given expression?

3 ビュー (過去 30 日間)
Addy
Addy 2018 年 6 月 4 日
コメント済み: Tosin Babarinde 2019 年 8 月 7 日
I have an expression. If I use the expression in a FEA software(COMSOL Multiphysics), It gives me a plot. But in matlab, How can I generate a plot like that? I have the expression but I have no idea to plot a signal like this. I have no experience other than plotting basic sin and cosine waves. Can anyone help me out? The expression is
A*(1-cos(2*pi*f*t/N))*sin(2*pi*f*t)*(t<(N/f))
the other values are f=250*10^6; A=35; N=5;
so it is a 5 cycle Gaussian pulse.. I have attached the picture of the plot I generated in COMSOL.
  1 件のコメント
Tosin Babarinde
Tosin Babarinde 2019 年 8 月 7 日
hi Addy,
good to know you asked this question here. I just got to start using MATLAB and COMSOL for some simulation. But I can not get to define as excitation signal in COMSOL which I think is what you were trying to do by defining this gauss signal in MATLAB.
do you mind giving some insight on how you did this?
I understand it's past a year already. but hoping you get this comment and have the chance to reply to me!
cheers,
Tosin

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

採用された回答

Rik
Rik 2018 年 6 月 4 日
Something like this?
f=250*10^6; A=35; N=5;
t=linspace(0,2*N/f,500);
V=A*(1-cos(2*pi*f*t/N)).*sin(2*pi*f*t).*(t<(N/f));
figure(1),clf(1)
plot(t,V)
  2 件のコメント
Addy
Addy 2018 年 6 月 5 日
Yes. Thank you Rik. It worked. Can I know why point multiplication plays an Important role here? Because when I was trying, I did not use that and I came no where near the solution. I was always getting 0 for V in the equation..
Rik
Rik 2018 年 6 月 5 日
The point signifies that a multiplication should be element-wise (same goes for division). If you don't, you're going to have a matrix multiplication, which changes the size. If you're not sure where to use a dot, you can always err on the safe side: any superfluous dots will be ignored.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePulse and Transition Metrics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by