Array of Numbers with error
4 ビュー (過去 30 日間)
古いコメントを表示
I have a fraction that I am multiplying by an array of data to create a new array, but I want the new array of data to have error for the new values.
2 件のコメント
回答 (1 件)
Ameer Hamza
2020 年 12 月 3 日
What type of noise you you want to add? Following shows an example with normally distributed noise.
acc79_18; % data from 1979 to 2018
acc_speed_18; % speed accident in 2018
percent = acc_speed_18/acc79_18(end); % calculate fraction
percent_all_years = per*ones(1,numel(acc79_18)) + 0.01*randn(); % normally distributed noise with std of 0.01
percent_all_years(end) = per; % for 2018, noise should not be added
acc_speed_all_years = percent_all_years.*acc79_18;
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!