Why my error handling function not working for multiple outputs?
显示 更早的评论
I am using arrayfun with multiple outputs as following.
[entryTime,exitTime] = arrayfun(@(id) entryExitTimeStampFun(id), ...
input_data.id(startRow:endRow),'ErrorHandler', ...
@entryExitTimeStampErrorHandler);
I have written a entryExitTimeStampErrorHandler.m function in the same folder as entryExitTimeStampFun.m as follows
function [entryTime,exitTime] = entryExitTimeStampErrorHandler
entryTime = nan;
exitTime = nan;
end
entryExitTimeStampFun.m fetches data from a database corresponding to the input id. But it fails for the cases where the data is now deleted in the database corresponding to that id.
It worked fine for me with missing id's for a single output using this following code.
logicalOutput = arrayfun(@(id) passingCentralZone(id,0.5), ...
input_data.id(startRow:endRow),'UniformOutput', false, 'ErrorHandler',@(varargin) false);
So I am afraid something is wrong with my errorhandling function.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Data Type Identification 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!