How to define an object witch has parameters and functions?

1 vue (au cours des 30 derniers jours)
Mr M.
Mr M. le 29 Oct 2018
Commenté : per isakson le 31 Oct 2018
How to define an object witch has parameters and functions?
  1 commentaire
per isakson
per isakson le 31 Oct 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

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Construct and Work with Object Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by