Checking if variable exists in GUI

조회 수: 2 (최근 30일)
Jakub
Jakub 2013년 4월 12일
Hi, in my GUI i want to check if variable m exists and if so do some stuff with it and if it doesnt exist do something else...I have solution using ishandle function but there are some problems with it and i have to make m global variable and i dont want to. Thanks for help!!

채택된 답변

Walter Roberson
Walter Roberson 2013년 4월 12일
if exist('m', 'var')
Or is 'm' not in the current workspace?
  댓글 수: 1
Jakub
Jakub 2013년 4월 15일
I have to make m global variable, which is sad. And if m is global variable , it exists but it doesnt containt any value. So one solution is to make m global variable and then instead of ifexist use isempty.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Function Creation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by