How to define an object witch has parameters and functions?

1 回表示 (過去 30 日間)
Mr M.
Mr M. 2018 年 10 月 29 日
コメント済み: per isakson 2018 年 10 月 31 日
How to define an object witch has parameters and functions?
  1 件のコメント
per isakson
per isakson 2018 年 10 月 31 日
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

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeConstruct and Work with Object Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by