Is it possible to change the unit of reluctance block of MATLAB from m.file?

조회 수: 2 (최근 30일)
ANANTA BIJOY BHADRA
ANANTA BIJOY BHADRA 2023년 5월 22일
편집: Paul 2023년 5월 22일
I am using a number of reluctance blocks for simulation and the values of the of that block are from workspace using the m.file. However, is there any way to change the unit as well? For example, the reluctance block requires values of length and area. The values are provided as 1m and 1m^2. I would like to change the length from 1m to 1cm. One way is the changing value 1 to 0.01 and keeping the unit to m. But I would like to keep the value as 1 and change the unit from m to cm. As the number of blocks are more, is there way to chnage the unit from the m.file? If so, how can I do that?

답변 (1개)

Paul
Paul 2023년 5월 22일
편집: Paul 2023년 5월 22일
It appears this can be done via typical set_param commands. For example, I have a Reluctance block selected in my model:
set_param(gcb,'CSA_unit','cm^2') % change the unit of cross-sectional area to cm^2
To see all parameters for the block
get_param(gch,'ObjectParameters')
There may also be other ways to achieve this goal. Check out Physical Units in the Simscape documentation for more dicussion.

카테고리

Help CenterFile Exchange에서 Magnetic Elements에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by