Matlab if 2 functions exist

6 ビュー (過去 30 日間)
Duncan
Duncan 2012 年 1 月 28 日
Hi, I am trying to figure out how to write for a code to display if only 2 variables are defined, but it seems to only work for one at a time? How can I get this to work?
  1 件のコメント
Jan
Jan 2012 年 1 月 28 日
The question is not clear enough to be answered.

サインインしてコメントする。

回答 (1 件)

Walter Roberson
Walter Roberson 2012 年 1 月 28 日
if exist('Var1', 'var') && exist('Var2', 'var')
display('Monday, Monday')
end
There is no way to pass two variable names to exist() to test both at the same time.

カテゴリ

Help Center および File ExchangeVariables についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by