I want to create a 'if' for a probability

1 次查看(过去 30 天)
How would I write that the prbability that I eat carrots this year knowing that I ate carrots last year is of 80%. And that the probabilities that I eat carrots this year knowing I didnt eat carrots last year is of 40%. Could you please help me out with this?

采纳的回答

Voss
Voss 2021-11-24
ate_carrots_last_year = false;
if ate_carrots_last_year
P_eat_carrots_this_year = 0.8;
else
P_eat_carrots_this_year = 0.4;
end

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Power and Energy Systems 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by