if-else with select run from specific value in matlab

2 Ansichten (letzte 30 Tage)
Anuchit Wibun
Anuchit Wibun am 4 Feb. 2015
Hello everybody!
Can anybody guide me how to do this right in matlab. Actually How I can distinguish condition from specific value that i defined.
ex.
p_d = [1 3 6 8 9];
c_d = [ 2 4 5 7 10];
if a == 1 || a==3 || a==6 || a==8 || a==9;
%do this;
else a==2 || a==4 || a==5 || a==7 || a==10;
%do that;
end
Kindly suggest me how to do it..
Thank you every much.

Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by