필터 지우기
필터 지우기

Expressions for Stereotype Default Value

조회 수: 2 (최근 30일)
AstroJon
AstroJon 2021년 3월 3일
댓글: AstroJon 2021년 3월 12일
In the System Composer Profile Editor, is it possible to use an expression to define the default value of a stereotype? For example, I have a camera hardware component that has focal length and effective aperture size defined as properties with no default values. Then I create a new property called "focal_ratio" and I want to set its default value to "focal_length / effective_aperture". I've tried entering several such expressions in to the default value field but always get an error message stating, "Cannot evaluate the expression..." Is there a particular syntax that will allow this to work?

채택된 답변

Jin Wang
Jin Wang 2021년 3월 12일
Hi,
I understand that you are trying to use syntax to define values and this syntax/expression is using known properties.
Unfortunately, the System Composer Profile Editor does not support syntax based on existent properties. Right now, it only support expressions using contant values, e.g. '7*9+8'. These expressions are treated as string and displayed in the default value edit box. However, they are evaluated and validated in the backend, so you will see a error message showing "Cannot evaluate the expression" for your case. I have forwarded your concerns to my colleague and we will discuss about supporting expressions containing existent properties.
Thanks,
Jin
  댓글 수: 1
AstroJon
AstroJon 2021년 3월 12일
That's unfortunate, but thank you for addressing it as a functional need. I think having such capability would make System Composer much more powerful.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 System Composer에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by