How to define an object witch has parameters and functions?

1 Ansicht (letzte 30 Tage)
Mr M.
Mr M. am 29 Okt. 2018
Kommentiert: per isakson am 31 Okt. 2018
How to define an object witch has parameters and functions?
  1 Kommentar
per isakson
per isakson am 31 Okt. 2018
See Create a Simple Class and you will find:
Here is the definition of BasicClass:
classdef BasicClass
properties
Value
end
methods
function r = roundOff(obj)
r = round([obj.Value],2);
end
function r = multiplyBy(obj,n)
r = [obj.Value] * n;
end
end
end

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Software Development Tools finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by