I want to create a 'if' for a probability

조회 수: 1 (최근 30일)
Nicholas Mathison Aba
Nicholas Mathison Aba 2021년 11월 24일
답변: Voss 2021년 11월 24일
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