/ concept-collection / jupyterlite-numbl-kernel
Sign in
concept-collection / jupyterlite-numbl-kernel
jupyterlite-numbl-kernel / demo / content / Square.m
13 lines · 240 BBlameHistoryRaw
1classdef Square < Shape
2 properties
3 s = 1
4 end
5 methods
6 function obj = Square(s)
7 if nargin > 0, obj.s = s; end
8 end
9 function a = area(obj)
10 a = obj.s^2;
11 end
12 end
13end
moveopenescclose