How to define an object witch has parameters and functions?

1 visualización (últimos 30 días)
Mr M.
Mr M. el 29 de Oct. de 2018
Comentada: per isakson el 31 de Oct. de 2018
How to define an object witch has parameters and functions?
  1 comentario
per isakson
per isakson el 31 de Oct. de 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

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Construct and Work with Object Arrays en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by