Bonsoir;
je veux utiliser une condition avec switch, est ce que je peux faire ça?
d'avance merciCode:
1
2
3
4
5
6
7 switch x case '0660'|'0661'|'0662'|'0663'|'0664'|'0665'|'0666'|'0667'|'0668'|'0669' figure; otherwise h=h+1; end
Version imprimable
Bonsoir;
je veux utiliser une condition avec switch, est ce que je peux faire ça?
d'avance merciCode:
1
2
3
4
5
6
7 switch x case '0660'|'0661'|'0662'|'0663'|'0664'|'0665'|'0666'|'0667'|'0668'|'0669' figure; otherwise h=h+1; end
Lu dans la documentation de SWITCH :
Donc :Citation:
When the case expression is a cell array (as in the second case above), the case_expr matches if any of the elements of the cell array matches the switch expression.
Code:
1
2
3
4
5
6 switch x case {'0660' '0661' '0662' '0663' '0664' '0665' '0666' '0667' '0668' '0669'} figure; otherwise h=h+1; end