detectOS

버전 1.1.0.1 (4.27 KB) 작성자: Jorg Woehl
Name and version number of the operating system
다운로드 수: 175
업데이트 날짜: 2021/5/6

View detectOS on File Exchange

detectOS

detectOS returns the name and version number of the operating system.

Purpose

For the development of cross-platform apps in MATLAB, it is useful to know the operating system (OS) on which MATLAB is running, e.g. to select native fonts and font sizes (see getOSfont) or to fine-tune the layout and design of graphical user interface elements. detectOS returns the name and version number of the underlying OS for a wide range of platforms and OS versions.

Usage

OS = detectOS returns the name of the operating system as a lowercase character vector, such as 'windows', 'macos' (which includes OS X), 'solaris', 'aix', 'ubuntu', 'centos', and many other Unix/Linux distributions. It is thus much more fine-grained than MATLAB's built-in ispc / ismac / isunix and computer functions. If the OS cannot be determined, an error is thrown.

[OS, OSVersion] = detectOS also returns the OS version number as a numeric row vector. For example, Windows 7 SP1 (version 6.1.7601) is reported as OS = 'windows' and OSVersion = [6, 1, 7601]. If the OS version cannot be determined, a warning is issued and the empty numeric array is returned.

For a list of Windows releases, see https://en.wikipedia.org/wiki/Ver_(command).

For a list of macOS releases, see https://support.apple.com/en-us/HT201260.

Requirements

detectOS is compatible with MATLAB R2016b and later releases (version 1.0 iscompatible with R2013a and later releases). It was tested on the following operating systems (64-bit, unless otherwise stated) and should run on a wide variety of other Unix/Linux distributions without any modification:

  • Windows 10 (10.0.10586)
  • Windows 8.1 Update 1 (6.3.9600)
  • Windows 7 (6.1.7601)
  • Windows 7 (6.1.7601), 32-bit
  • Windows XP Pro SP3 (5.1.2600),32-bit
  • macOS Sonoma (14.4.1)
  • macOS Ventura (13.0.1)
  • macOS Big Sur (11.2.3)
  • macOS Catalina (10.15.7)
  • macOS Sierra (10.12.1)
  • OS X El Capitan (10.11.6)
  • Ubuntu 16.04 LTS
  • Ubuntu 15.10
  • Ubuntu 14.04 LTS
  • CentOS 7
  • CentOS 6.8 (Final)

Motivation

Another great tool returning information about the CPU and operating system is CPU Info. Unfortunately, CPU Info does not differentiate between Unix/Linux distributions, and does not return sensible information about the OS version in these cases. Adding this capability was the main motivation for developing detectOS.

Feedback

Please let me know if you have tested detectOS on other operating systems. Any feedback or suggestions for improvement are welcome!

인용 양식

Jorg Woehl (2024). detectOS (https://github.com/JorgWoehl/detectOS/releases/tag/v1.1.0.1), GitHub. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2013a
R2016b 이상 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

GitHub 디폴트 브랜치를 사용하는 버전은 다운로드할 수 없음

버전 게시됨 릴리스 정보
1.1.0.1

See release notes for this release on GitHub: https://github.com/JorgWoehl/detectOS/releases/tag/v1.1.0.1

1.0.0.0

Small change in file description
Added macOS Sierra to tested platforms
Added space
Minor change to image.
Teaked file description
Added image
Updated description and image
Updated file description
Added space
Updated picture
Updated comments and description

이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.
이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.