Libraries equivalent for referenced subsystems

2 ビュー (過去 30 日間)
Adrian Cristian
Adrian Cristian 2022 年 4 月 5 日
コメント済み: Adrian Cristian 2022 年 4 月 11 日
Hello! In a script I am using, it is present the "all_libs" variable. Do you know a replacement for it to not search libraries but referenced subsystems? I'll leave down the part of the script where I use "all_libs". I used the script in Matlab R2017b to compare scalings from frame to core in an application. There I had libraries to search into, but with the new revisions there are no longer libraries, but referenced subsystems, and the script no longer works. It's like it doesn't recognize the core from the application and can't compare the scalings from frame. If I run it, it starts to work for a few minutes, but it compares the frame signals with something called "i_value" (I don't have anywhere in the code anything named like that) and after that it stops and gives an error. I use Matlab R2020b, TargetLink 5.1p1
all_libs = libinfo(frame_handle);
num_in = [];
num_out = [];
for fi = 1:numel(find_system(bdroot, 'RegExp','on','BlockType','SubSystem','ReferencedSubsystem', '.'))
if contains(all_libs(fi).Library, '_function') || contains(all_libs(fi).Library, '_Funktion')
core_handle = all_libs(fi).Block;

回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2022 年 4 月 6 日
The library option in find_system()
'FollowLinks', 'on' or 'off'
Also
'LookInsideSubsystemReference', 'on' or 'off'
See doc of find_system
  3 件のコメント
Fangjun Jiang
Fangjun Jiang 2022 年 4 月 7 日
Your code has fundermental problems. In your original code
"all_libs" is the library blocks
"fi" is a loop for subsystem reference blocks.
These two types of block are like orange vs apple.
Yet you are using "all_libs(fi)". I don't understnad.
Adrian Cristian
Adrian Cristian 2022 年 4 月 11 日
Eventually I've replaced the IF statement with a FOR. But afterwards, it seems like the script doesn't want to recognize the IF statements. If I put breakpoints on the first line after an IF, it won't stop. I never coded in matlab language so it's very confusing for me. I got this script at work and I have to make it on Matlab R2020b. On Matlab R2017b works, but the applications we have in that contain Libraries, and I think the ones on Matlab R2020b, but have Referenced subsystems instead of normal subsystems.

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

カテゴリ

Help Center および File ExchangeSubsystems についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by