MATLABã§åç §å
Wikipediaã«ã¯
MATLAB ã¯åç §ãæããªãããããªã¼ãã³ããã·ã¥ãã¼ãã«ãç·å½¢ãªã¹ããæ¨æ§é ããã®ä»è¨ç®æ©ç§å¦ã§ä¸è¬çã«ç¨ããããéæ¥åç §ãå«ããã¼ã¿æ§é ãå®è£ ããã®ã¯å°é£ã§ããã
http://ja.wikipedia.org/wiki/MATLAB
ãªãã¦æ¸ãã¦ãããã©ï¼å®ã¯MATLABã«ãåç
§åã¯åå¨ãããããï¼ã¯ã©ã¹ãããã³ãã«ã¯ã©ã¹ãã¨ãã¦å®ç¾©ããã¨ï¼ãã®ã¯ã©ã¹ã®ãªãã¸ã§ã¯ãã¯åç
§åã«ãªãã¨ãï¼
以ä¸ã³ã¼ãä¾ï¼ãhandleãã¯ã©ã¹ãç¶æ¿ããã¯ã©ã¹ã¯ããã³ãã«ã¯ã©ã¹ãã«ãªãã¾ã (ç´ãããã)ï¼ã¤ã¾ã以ä¸ã®counterã¯ã©ã¹ã®ã¤ã³ã¹ã¿ã³ã¹ã¯åç
§åï¼
classdef counter < handle properties (GetAccess=public, SetAccess=private) count = 0 end methods function incr(obj) obj.count = obj.count + 1; end end end c = counter c.count % => 0 c.incr c.count % => 1
ãªãã ãã¨ã£ã¦ãè¬ä»æ§ï¼ã¨ã¯ããï¼åç
§åã使ããããã«ãªã£ããã¨ã§ï¼ãªã³ã¯ãªã¹ãã¨ãã®ãã¼ã¿æ§é ãå®ç¾©ãããï¼ãªãã¸ã§ã¯ãã®ããããã£ãåçã«æ¸ãæãããã§ããããã«ãªãã®ã§ï¼ãªã«ãã¨ããããï¼å¤ãæ¸ãæãããã³ã«ãªãã¸ã§ã¯ããã³ãã¼ããã®ã¨æ¯è¼ãã¦ï¼åä½é度ãéããªãããããªãããªï¼
ãã£ããï¼é¢æ°åè¨èªã§ããªãã®ã«ãªãã¸ã§ã¯ãã¯åºæ¬çã«ã¤ãã¥ã¼ã¿ãã«ã¨ãï¼ããããã¦èããã¨å²ã¨ã¨ãã§ããªãä»æ§ã ãªï½