File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 1+ function r = is_rosetta()
2+ % IS_ROSETTA Returns true if running on Apple Silicon using Rosetta (Matlab Intel binary)
3+
4+ r = false ;
5+
6+ if ~ismac
7+ return
8+ end
9+
10+ % uname -m reports "x86_64" from within Matlab on Apple Silicon if using Rosetta
11+
12+ [ret , raw ] = system(" sysctl -n sysctl.proc_translated" );
13+ r = ret == 0 && startsWith(raw , " 1" );
14+
15+ end
Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ function test_platform(tc)
2626tc .verifyThat(stdlib .iswsl , IsOfClass(' logical' ))
2727tc .verifyThat(stdlib .has_wsl , IsOfClass(' logical' ))
2828
29+ tc .verifyThat(stdlib .is_rosetta , IsOfClass(' logical' ))
30+
2931tc .verifyThat(stdlib .isinteractive , IsOfClass(' logical' ))
3032
3133tc .verifyThat(stdlib .is_windows_powershell , IsOfClass(' logical' ))
You can’t perform that action at this time.
0 commit comments