필터 지우기
필터 지우기

arguments or properties for each class? efficiency?

조회 수: 1 (최근 30일)
marilia15
marilia15 2012년 4월 11일
Hi, I have the main program with a property X which is a handle object with lot of properties. The main program creates a lot of instances of other class (genetic algorithm) and all these instances use the same X from main program. What is more efficient, use properties or arguments?
a)each specie include X as a own property, so all the methods of the specie can access easily to all the properties of X.
b) main program call methods of each specie using properties of X as arguments.
which option use more memmory? which option is faster?
Thanks

답변 (1개)

Daniel Shub
Daniel Shub 2012년 4월 11일
Loren had a recent post about this on her blog:
I have not fully digest that post, nor do I fully understand the inefficiencies of MATLAB OOP, but I think the more your can reduce calls to properties of objects, the better off you are.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by