Is there a function to check the convertibility to logical values that do not raise an error in the if statement? For example,
if struct()if {}
will cause errors. I know I can check by:
function isLS = islogicalable(x)isLS = false;try if x end isLS = true;end
But is there a function for checking this? Or is it true that only numeric, logical and char can be converted to logical values?
Best Answer