add MATLAB tags to enable repo map support

This commit is contained in:
Matthew Tofano 2025-06-23 21:24:52 +01:00
parent fdb49e18cd
commit 20429b6852
4 changed files with 65 additions and 0 deletions

42
tests/fixtures/languages/matlab/test.m vendored Normal file
View file

@ -0,0 +1,42 @@
classdef Person
properties
name (1,1) string
age (1,1) double
end
methods
function obj = Person(name, age)
arguments
name (1,1) string
age (1,1) double = NaN
end
% Constructor for Person class
obj.name = name;
obj.age = age;
end
function greeting = greet(obj,formal)
arguments
obj
formal (1,1) logical = false
end
if formal
prefix = "Good day";
else
prefix = "Hello";
end
greeting = sprintf("%s, %s!", prefix, obj.name);
end
end
end
function greetings = create_greeting_list(people)
arguments
people (1,:) Person
end
% Create greetings for a list of people.
greetings = string(numel(people), 0);
for i = 1:numel(people)
greetings(i) = people(i).greet();
end
end