gca function in matlab
이전 댓글 표시
I have read the matlab docs but I don't understand what gca really does. Can somebody explain it to me? Thanks!
채택된 답변
추가 답변 (1개)
Salaheddin Hosseinzadeh
2014년 8월 20일
Hi Civs,
To my knowledge whenever an object is created (figure, window, axes, function,...) a handle is associates to the object it's like when you want do define a number value, you assign it to a variable,
a = 2;
when you create a figure, axes and ... you can assign them to a variable(handle)
h = figure()
I = axes()
so when you want to plot on a specific axes, let's say you have 10 figures and axes open, and you want to plot on an axes you previously names regression
regression = axes(); % this creates an axes and name it regression
plot(regression,x,y); % this plots on the axes named regression not the other ones
to find which axis is currently viewing or which one is recently clicked (viewed), or more programmatically speaking has the focus, you can use gca which gives you the handle(assume it as variable) to the current figure.
read more about handles it's useful.
카테고리
도움말 센터 및 File Exchange에서 Graphics Object Properties에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!