Schoolholidays
%SCHOOLHOLIDAYS returns holidays for a given year(s) and german federal state
function [result, resultmsg, resultcode] = schoolholidays(hyear, hstate, varargin)
% [result, resultcode, resultmsg] = schoolholidays(hyear, hstate)
% Retrieve school holidays for a given year(s) (hyear) and federal german
% state(s) (hstate).
%
% Inputs:
% - hyear: one double or vector of doubles: year of holidays
% - hstate:
% - char: one federal state, full name or official 2-letter
% abbreviation, see function file and struct settings for
% correct values.
% - cell of chars: one or more federal states named as above
% - numeric: 1...16: number of state (counted in alphabetical
% order)
% - varargin: override settings, submitted as 'settings-field', 'value'
% eg. 'method', 'api2'; or 'verbose', 1
%
% Outputs:
% - struct result: e.g.:
% result.holidays2016.BY, which is a vector of datenums of all school
% holidays in 2016 and Bavaria.
% OR
% empty double [] if data acquisition fails
%
% - resultmsg: returns detailed success and/or fail message
%
% - resultcode (in case of a fail result returns char error message):
% 2: success: holidays collected and processed. Holidays from
% previous year also fetched and considered.
% 1: partly success: holidays collected and processed, but not all
% data from previous year found.
% 0: no connection to API, but settings.fallBack was set to 1, so
% internal backup data of 2016 is returned whatever given year
% -1: fail: no connection to API possible, file not found
% -2: fail: wrong API method specified
% -3: fail: wrong state name or number submitted
% -4: fail: wrong type of hyear (must be double!)
% -99: fail: other error
% (C) Johannes Tonn, Christian Kandler
% Version Apr/01/2016
Cite As
Christian (2026). Schoolholidays (https://www.mathworks.com/matlabcentral/fileexchange/56254-schoolholidays), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
