where to find variables being set in Example model simrfV2_radar_system

1 回表示 (過去 30 日間)
Robbin Roddewig
Robbin Roddewig 2024 年 1 月 29 日
回答済み: Debadipto 2024 年 2 月 9 日
There are variables being set in the Simulink radar model example file simrfV2_radar_system.slx. For example if you look in the Target subsystem block in the model (down arrow or right click and Mask>Look Under Mask) there is a variable Speed. There are actually quite a few variables scattered in here like Doppler etc. Where are these being set? They dont appear in the Target mask inputs. In fact there is a variable in the mask inputs and I cannot find that either, radar_system_targetSpeed. I looked in the init functions and poked around the model. No luck.
Appreciate any help!
  2 件のコメント
Debadipto
Debadipto 2024 年 2 月 6 日
編集済み: Debadipto 2024 年 2 月 6 日
I couldn't find the mentioned model 'simrfV2_radar_system.slx'. Can you please provide a link to that?
Robbin Roddewig
Robbin Roddewig 2024 年 2 月 8 日
It came with the Matlab example files with 2023b. I just stumbled across it but was under the impression that it was generated by Mathworks.

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

回答 (1 件)

Debadipto
Debadipto 2024 年 2 月 9 日
Hello @Robbin,
So there are two things that we need to understand here: "Object parameters" & "Workspace variables". In simple words, "object parameters" in MATLAB refer to the internal attributes of a block. For eg. 'Speed' here is an object parameter of the 'Target' block. How do we verify? Simply in the MATLAB command window, type:
get_param('simrfV2_radar_system/Target', 'ObjectParameters')
You will see a list of struct objects appear. Notice that 'Speed' is also a part of it, which indicates it is indeed a parameter of the 'Target' block. Consequently, to see the value of 'Speed', run:
get_param('simrfV2_radar_system/Target', 'Speed')
You will see the result being 'radar_system_targetSpeed' (you might need to compile the model first!).
The varibale 'radar_system_targetSpeed' is a "workspace variable" in this context. More specifically, a base workspace variable, which can be verified by simply checking the base workspace. Generally, you can get this information by looking at the Model Explorer menu of the Simulink model.
Hope this answers your query!

カテゴリ

Help Center および File ExchangeRadar and EW Systems についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by