Basic Axes Handle question

1 次查看(过去 30 天)
Ok so this is an extremely basic question.
If I write
h=gca
Matlab should create a new figure with axes and give me its handle. Exactly how its described in the helpfile.
But if I try to do this
set(h, 'title', 'testtitle')
I get an error saying
??? Error using ==> set Value must be a handle
I dont understand why MATLAB doesnt think its a handle, its obviously an axes handle.

采纳的回答

Fangjun Jiang
Fangjun Jiang 2011-10-26
h=gca;
TitleHandle=get(h,'title')
set(TitleHandle,'string','this is title text');

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by