Executing multiple cases
Title
Question
How to execute multiple cases if the condition is true in a select statement?
Scilab Conditional-Branching 03-04 min 50-60 sec
Answers:
Add the tasks to the same true case.
For example, you want to add a and b, and then multiply c and d, if a condition is true. Do the following:
select x;
case x == true
a+b
c+d
so on and so forth...
a+b
c+d
so on and so forth...
x='B'
select x;
case x =='A'
disp(x)
case x=='B'
disp(x)
case x=='C'
disp(x)
end
you can write multiple cases like this
Login to add comment