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 CenterFile Exchange에서 Simulink Environment Customization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by