How to get nan as output if the function output argument is not supported?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Struggling in MATLAB
le 21 Avr 2022
Commenté : Struggling in MATLAB
le 22 Avr 2022
I have written a function with three outputs.
function [logical_out, run_time, reaction_time] = reaction_time_function3(~,~,~)
% code
end
I want run_time and reaction_time output to be 'NaN' if logical_out is 0. How can I do that? In fact, I have written a piece of code not to run the script further if logical_out is 0.
% do not run further calculations if logical ouput is zero
if logical_out == 0
return
end
0 commentaires
Réponse acceptée
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Function Creation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!