if-else with select run from specific value in matlab

1 次查看(过去 30 天)
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.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by