Is it possible to add Area annotation programmatically?

Hi,
I was wondering if it would be possible to programmatically add area annotation to a model in Simulink.
I have used Simulink.Annotation() to add textual annotation which works fine. I'm looking for a way of highlighting a particular section of the model programmatically depending on certain conditions. The size and position of the area would be determined at runtime.
Any pointers would be much appreciated.
Thank you,
sunny

 채택된 답변

Fangjun Jiang
Fangjun Jiang 2018년 5월 9일

0 개 추천

An "Area" is an "Annotation", with empty "Name", "DropShadow" set as "On".

댓글 수: 3

Not sure that's true.
You can move blocks inside an area together, create a subsystem from blocks inside an area, etc. So I don't think an area annotation is same as an empty text annotation.
You are right, although my statement is also true if you run get_param() on an "Area" and an "Annotation". Anyway, I found a way to create an "Area" by command line:
f14;
add_block('built-in/Area','f14/area','position',[500,20,900,400])
Hi Fangjun Jiang,
That is exactly what I was after. I must've overlooked it in the documentation, so I was always using Simulink.Annotation() instead of add_block(). Thank you.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

daanav
daanav 2018년 9월 11일

0 개 추천

A follow up question to this. Can one take a screenshot of only the area created?

카테고리

도움말 센터File Exchange에서 Simulink Functions에 대해 자세히 알아보기

질문:

2018년 5월 9일

답변:

2018년 9월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by