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