How to define an object witch has parameters and functions?

2 views (last 30 days)
Mr M.
Mr M. on 29 Oct 2018
Commented: per isakson on 31 Oct 2018
How to define an object witch has parameters and functions?
  1 Comment
per isakson
per isakson on 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

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!