Why can't I change my WindowStyle setting ?

100 ビュー (過去 30 日間)
Sebastian Sigler
Sebastian Sigler 2016 年 7 月 13 日
コメント済み: woo jin kim 2023 年 1 月 16 日
Hi, I am a Matlab programming beginner and I am trying to use the Matlab Report Generator to print several figures. I would like to change some figure properties before printing them, like the color, units and position:
figure
plot(randn(100,1));
set(gcf,'units','centimeters');
set(gcf,'WindowStyle','normal');
set(gcf,'Color',[1 1 1]);
set(gcf,'position',[10 10 18 9]);
The execution of that command works just fine and I get a normal figure with the changes I wanted but when I try to run the file with the Report Generator none of the changes are applied to my figure. Usually I get the error message "Cannot set Position while WindowStyle is 'docked'". When I check the figure properties, the WindowStyle is 'docked' (which is weird because the default value itself should be 'normal' and I explicit changed it to 'normal').
Can someone help me fix this annoying problem ?

回答 (1 件)

Sudhanshu Bhatt
Sudhanshu Bhatt 2016 年 7 月 19 日
Hi Sebastian,
Sometimes, while working with figures, if the figure window is docked unknowingly, it might give the docking error message. To verify this, you can type in the following command in the MATLAB command prompt:
>> get(0,'DefaultFigureWindowStyle')
If the output of this command is 'Docked', then the figure window is docked and you can use the following command to undock it:
>> set(0,'DefaultFigureWindowStyle' , 'normal')
Once the figure window is undocked, please try using the report generator tool again.
If this does not resolve you issue, please create a case with MathWorks Technical Support by using the URL below:
Hope this helps!
Thanks
Sudhanshu Bhatt
  1 件のコメント
woo jin kim
woo jin kim 2023 年 1 月 16 日
Thank you i solve this problem!!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDownloads についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by