How to use the exist feature with an if statement?

24 visualizzazioni (ultimi 30 giorni)
exist varname gives valid output. But if(exist varname) throws an error as "Unexpected matlab expression". How to fix this?

Risposta accettata

Fangjun Jiang
Fangjun Jiang il 24 Apr 2019
if exist('VarName','var')

Più risposte (0)

Categorie

Scopri di più su Argument Definitions in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by