How to use the exist feature with an if statement?

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

Accepted Answer

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

More Answers (0)

Categories

Find more on Argument Definitions in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!