isleap.m

This file test if a given year is a normal year or a leap year.

이 제출물을 팔로우합니다

A script to assess if a given year (in the Gregorian Calendar system) is a leap year or not.

It returns 0 if is not a leap year,
it returns 1 if it is a leap year.

Examples:

>> isleap(1900)

ans =

0

>> A = [1200 1538 2001 ; 816 1900 1908 ; 2000 2004 2011]

A =

1200 1538 2001
816 1900 1908
2000 2004 2011

>> isleap(A)

ans =

1 0 0
1 0 1
1 1 0

It looks at the remainder of the division, if the year is divisible by 4, 100 and 400 and makes the decision according to it. (For a year ending in 00 is not a leap year unless is divisible for 400 too).

인용 양식

Isaac Mancero Mosquera (2026). isleap.m (https://kr.mathworks.com/matlabcentral/fileexchange/31778-isleap-m), MATLAB Central File Exchange. 검색 날짜: .

카테고리

Help CenterMATLAB Answers에서 Dates and Time에 대해 자세히 알아보기

일반 정보

MATLAB 릴리스 호환 정보

  • 모든 릴리스와 호환

플랫폼 호환성

  • Windows
  • macOS
  • Linux
버전 퍼블리시됨 릴리스 정보 Action
1.1.0.0

I deleted unnecessary code, now it's a one line code.

1.0.0.0