Can't delete MATLAB Function Input in Simulink?

2 ビュー (過去 30 日間)
TimonD
TimonD 2019 年 5 月 31 日
コメント済み: Shivam Sardana 2019 年 6 月 3 日
Hello,
In my Simulink model i have a MATLAB Function that used to have three inputs. Now i don't need one of these inputs anymore and (of course) decided to delete it. As soon as i do so i can't run my Simulink model anymore even tho the variable is not even used by the functions code! The error I was getting was:
"Errors occurred during parsing of MATLAB function ..... "
I've rewrittten the code but still the same error appeared.
Now even tho I didn't try anything diferen't i keep getting the Error
"Simulink cannot determine sizes and/or types of the outputs for block 'lca_simulink/Lane Changing Assist/MATLAB Function' due to errors in the block body, or limitations of the underlying analysis. The errors might be inaccurate. Fix the indicated errors, or explicitly specify sizes and/or types for all block outputs."
I tried defining the Output-type in the Model Explorer but that didn't change anything. Is this just a random error or did I do anything wrong?
This is the function and "xObjMemoryOld" is the variable i want to delete. As you can see it's not in the code... if i just leave it in there and leave it unconnected my Model runs perfectly? isn't this weird?
function [RearClearMemory, RearClearSmooth]= SmoothenRearClearSignal(RearClearMemory,RearClear,xObjMemoryOld)
RearClearRelevant = RearClearMemory(~isnan(RearClearMemory));
if length(RearClearMemory) > length(RearClearRelevant)
RearClearMemory(length(RearClearRelevant) + 1) = RearClear;
else
RearClearMemory(1:end-1) = RearClearMemory(2:end);
RearClearMemory(end) = RearClear;
end
RearClearRelevant = RearClearMemory(~isnan(RearClearMemory)); % so last value is also used
RearClearSmooth = median(RearClearRelevant(:));
if RearClearSmooth == 0.5
RearClearSmooth = 0;
end
if length(RearClearRelevant) <= 5
RearClearSmooth = 1;
end
Thanks for your help,
Timmy
  1 件のコメント
Shivam Sardana
Shivam Sardana 2019 年 6 月 3 日
Please attach your Simulink model so that it would be easy to understand the problem.

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

回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by