A switch case statement that will help me to either run codeS in Windows or linux, based on whichever OS it is
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I want to write a switch case statement that will help me to either run my code in Windows or linux, based on whichever OS it is. Any Suggestions!
0 commentaires
Réponse acceptée
Daniel M
le 23 Oct 2019
Modifié(e) : Daniel M
le 23 Oct 2019
if ismac
% Code to run on Mac platform
elseif isunix
% Code to run on Linux platform
elseif ispc
% Code to run on Windows platform
else
disp('Platform not supported')
end
And you can easily adapt that to a switch if you like.
Taken from this page:
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Startup and Shutdown 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!