필터 지우기
필터 지우기

Constant properties in classes

조회 수: 10 (최근 30일)
Ahmed Hossam
Ahmed Hossam 2017년 5월 17일
댓글: Ganesh Gajavelli 2018년 3월 2일
Hi,
is it possible to define a constant property in a class which depends on other constant properties in the same class?
Would that also be correct?
thank you for your answer in advance!

채택된 답변

Guillaume
Guillaume 2017년 5월 17일
Yes, constant properties can be calculated from other constant properties. It's the first example in the doc actually.
  댓글 수: 4
Guillaume
Guillaume 2017년 7월 29일
As shown in the very first example in the link in my answer, you have to use the syntax:
classdef App1
properties (Constant)
a = 1;
b = App1.a+1;
end
Ganesh Gajavelli
Ganesh Gajavelli 2018년 3월 2일
Yes, that was it for me too! Thanks so much!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Whos에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by