How can I create a random input similar to "band-limited white noise", but in an m-file in an ODE to solve with ode45?

4 次查看(过去 30 天)
I would like to write an m-file in which an ordinary differential equation is defined.
I have to add a gaussian white noise to that. I have created a file in Simulink for that, but I am not able to write similar code.

回答(2 个)

Fangjun Jiang
Fangjun Jiang 2020-8-10
rand()

Ali Hajnayeb
Ali Hajnayeb 2020-8-10
Actually, "randn()" is better and creates numbers with normal distribution, but the variance of the output of the ODE would not match Simulink.

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by