if-else with select run from specific value in matlab

2 views (last 30 days)
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.

Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!