相关疑难解决方法(0)

是否可以在没有try块的情况下测试函数句柄?

有可能用不使用异常的东西替换下面的代码吗?手柄x是提供的手柄.我想在使用之前测试它的有效性(使用实际代码来支持句柄).

x = @notreallyafunction;
try
   x();
catch 
   disp('Sorry function does not exist.');
end
Run Code Online (Sandbox Code Playgroud)

matlab function handle function-handle

5
推荐指数
1
解决办法
334
查看次数

标签 统计

function ×1

function-handle ×1

handle ×1

matlab ×1