Filter löschen
Filter löschen

if-block_in_switch_case

1 Ansicht (letzte 30 Tage)
Muazma Ali
Muazma Ali am 26 Apr. 2020
Beantwortet: AKARSH KUMAR am 24 Jun. 2020
Hi ! I want to know how I can use if blocks within a switch case block I know it is possible but dont know whether I can write an if block right after 'case' line or do I have to write something right after saying 'case':
function aktivitet_samlet= fra_molfraksjon_salt(best_salt_nr_1, best_salt_nr_2, ny_vekt_prosent)
switch best_salt_1
case 'NH4CL'
I mean here can I right an If block directly..?
  1 Kommentar
Stephen23
Stephen23 am 26 Apr. 2020
"I mean here can I right an If block directly..?"
Yes.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

AKARSH KUMAR
AKARSH KUMAR am 24 Jun. 2020
Yes you can, inside any case you can write if else statements.

Kategorien

Mehr zu Modeling finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by