Matlab: How to set variable to 1 if running on Windows / to 0 if running on Linux or Unix
os_detection.m
if isunix || ismac
osFlag = 0; % Linux/Unix/macOS
elseif ispc
osFlag = 1; % Windows
end
Check out similar posts by category:
Matlab/Simulink
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow