How do you set the default annotation properties?

I recently migrated to a newer version of Matlab/Simulink. In the old version, the default annotation "HorizontalAlignment" was "center." In the newer version, the default is "left." How can I change my global defaults so that the annotation "HorizontalAlignment" property is "center" again?

Answers (1)

set(groot,'defaultTextHorizontalAlignment', 'center')
You will want to put this into your startup.m

2 Comments

Thank you for your response Walter.
I successfully added the command you suggested to the startup.m file and verified that the command was executed when I started up Matlab (I added a disp command right after the set command and displayed a message indicating that the startup.m file had been run).
I then added a new annotation text to my Simulink model and the text alignment was still set to "left." Here is the entry for the new annotation text from the saved .mdl file:
Annotation {
SID "10013"
Name "Annotation Test"
Position [7825, 4106, 7894, 4121]
AutoSize on
WordWrap off
HorizontalAlignment "left"
VerticalAlignment "top"
}
The command was accepted by Matlab without error but I don't know what it actually changed.
Do you have any other ideas? Are the default values of the "annotation" object in a library template or something?
I've been searching on the Matlab help and doing internet searches and have not been able to find any documentation yet (it has been frustrating).
I am running Matlab R2013b and my previous version (that had the default annotation text alignment set to "center") was R2010bSP1.
Thanks again!
Sorry, I do not know anything about how Simulink creates annotations.

Sign in to comment.

Categories

Products

Asked:

on 9 Jan 2018

Commented:

on 10 Jan 2018

Community Treasure Hunt

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

Start Hunting!