how to check whether the variable is present or not ?
Mostra commenti meno recenti
hi, I have tried if condition with the help of "exist" as:
checkVariable1= exist('lbl_edge','var');
if checkVariable1==1
edge= newedge1;
else
edge = newedge2;
end
I have also tried
if any(strcmp(who,'lbl_edge'))==1
....
else
...
end
But none of them are working. Can you please help me...
Thanks
Risposta accettata
Più risposte (1)
Image Analyst
il 9 Dic 2014
checkVariable1= exist('lbl_edge','var');
will work. Perhaps you have the Image Processing Toolbox and have conflict between your variable name of edge and the IPT function called edge(). Pick a different name.
Categorie
Scopri di più su Object Analysis in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!