Generating signal from weibull distribution

2 ビュー (過去 30 日間)
Davide Sasso
Davide Sasso 2023 年 1 月 23 日
回答済み: Paul 2023 年 1 月 23 日
Hi, i have a Weibull distribution that is representative of wind speed data and I want to create a continious signal in MATLAB to recall in a Simulink model. I tried with the function wblrnd putting in the scala and form parametres but i failed to create the signal itself.
  2 件のコメント
Jiri Hajek
Jiri Hajek 2023 年 1 月 23 日
Hi, in what form do you have the Weibull distribution? Seems like you need an m-file representing the function, right?
Davide Sasso
Davide Sasso 2023 年 1 月 23 日
編集済み: Davide Sasso 2023 年 1 月 23 日
I have reproduced the function already, hypotizing the scala and form parametres like I said up. I only search to create a continuous signal, that go on for 60 seconds, that is representative of the weibull distribution's values. This is what I wrote to create the weibull distribution:
x = linspace(0,19);
plot(x,wblpdf(x,5.5556,2));
grid on
xlabel('$v$ $[m/s]$','Interpreter', 'latex', 'FontSize', 15)
ylabel('$p(v)$','Interpreter', 'latex', 'FontSize', 15)

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

回答 (1 件)

Paul
Paul 2023 年 1 月 23 日
Hi Davide,
The functions wblpdf and wblrnd are both eligible for code generation, so you can call either from inside a Matlab Function block without too much trouble. However, if you use wblrnd that way I have no idea which random stream is used nor how you can control that stream, e.g., for Simulink run repeatbility.
Another option would be to implement inverse sampling in the model, which could probably very well approximate a Weibull distribution and has the advantage of using the Uniform Random Number block for which you can control the seed.

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by