An example of a simple class is provided below. classdef hello methods function greet(this) disp('Hello!') end end end When put into a file named hello.m, this can be executed with the following commands: >> x = hello; >> x.greet(); Hello!
Na primer: classdef hello methods function greet(this) disp('Hello!') end end end Kada se stavi u fajl sa nazivom hello.m, ovo može da se izvršava uz pomoć sledećih komandi: >> x = hello; >> x.greet(); Hello!