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 CenterFile Exchange에서 Construct 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