How do I change a table lookup algorithm option for all the table lookup blocks in a large Simulink model?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I recently ran the Model Advisor on a Simulink model and allowed it to change the settings on all my table lookup blocks. The Advisor suggested checking the "Begin index search using previous index result" to improve performance. However, this option causes my auto-coded model to crash at startup. Now I need to "uncheck" this algorithm option for all my table lookup blocks. Since this is a large model with probably 100 or more table lookups, I need a shortcut!
0 Kommentare
Antworten (1)
Suman
am 22 Aug. 2024
Bearbeitet: Suman
am 22 Aug. 2024
Hi Jeff,
You can do it programaticaly with a simple MATLAB script.
1. Get all the Lookup Table blocks present in the model:
lookupBlocks = find_system(modelName, 'FollowLinks', 'on', 'LookUnderMasks', 'all', ...
'BlockType', 'Lookup_n-D');
2. Now loop over all the blocks and "check" or "uncheck" the "Begin index search using previous index result" options as needed:
for i = 1:length(lookupBlocks)
block = lookupBlocks{i};
try
set_param(block, 'BeginIndexSearchUsingPreviousIndexResult', false);
catch ME
% In case this parameter does not exist
warning('warning msg: %s', ME.message);
end
In general if you want to set some parameter value for any entity in your model, you can use the above approch. To find the "tag" for that parameter, you can use the following command:
get_param(entity_handle, 'ObjectParameters')
%or
get_param(entity_handle, 'DialogParameters')
I hope that helps!
0 Kommentare
Siehe auch
Kategorien
Mehr zu Simulink Coder finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!