有可能用不使用异常的东西替换下面的代码吗?手柄x是提供的手柄.我想在使用之前测试它的有效性(使用实际代码来支持句柄).
x
x = @notreallyafunction; try x(); catch disp('Sorry function does not exist.'); end
matlab function handle function-handle
function ×1
function-handle ×1
handle ×1
matlab ×1