write statement without using for loop

1 次查看(过去 30 天)
Untitled.png
how to write this statement without using for loop

采纳的回答

madhan ravi
madhan ravi 2019-2-17
gi=Alpha.*(bi==0)+Beta.*(bi==1)

更多回答(1 个)

aara
aara 2019-2-17
use if condition?
if bi = 0
gi == alpha;
else
gi == beta;
end

Community Treasure Hunt

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

Start Hunting!

Translated by