R2022a, Failed to evaluate mask initialization Caused by: Too many input arguments

4 次查看(过去 30 天)
This code worked in R2019b and R2020b, but does not in R2022a:
set_param('pathofblock/name_of_blockwithmask','RAM_type',RAM_type); % RAM_type is either 'BRAM' or 'URAM'
Error in 'pathofblock/name_of_blockwithmask': Failed to evaluate
mask initialization commands.
Caused by:
Too many input arguments.
  1 个评论
Tim King
Tim King 2023-5-11
after looking into it further I found that R2022a has wrapped the intialization code in another function that doesn't include the arguments I had in my function...
R2019b version of mask code:
init_foo(gcb,...
RAM_type,RAM_type_prev)
R2022a version (converted by matlab when i opened model in R2022a):
% Initialization code section
function initialization()
init_foo(gcb,...
RAM_type,RAM_type_prev)
end
% Parameter callback section

请先登录,再进行评论。

采纳的回答

Tim King
Tim King 2023-5-11
I found the problem!
I was calling...
add_block('Simulink/Commonly Used Blocks/Subsystem',[sys '/' subsystem_name ]); %add subsystem
and with R2022a this capital 'S' is no longer recognized, you must use the small 's'.
(in R2020b and before this capital 'S' worked fine, I guess the folks at mathworks no longer like Tower of Power :) )

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Modeling 的更多信息

标签

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by