Error: "This call-site passes more inputs to this function than it can accept."

Hi,
I developed a new library in Simulink in which I have a Matlab function block. Within the block code I need to call other Matlab functions. Some of these functions have String input arguments (fcn('str1',str2', double..)).
I also have a Matlab model to execute the exact same thing as my Simulink library is suppose to do. When I run in Matlab the simulation is successfully done, in Simulink, on the other hand, I get errors.
The errors are related to these functions I mentioned above and I get the message: "This call-site passes more inputs to this function than it can accept."
I understand Simulink does not support char variables. I am only using char variables within the Matlab function code in which I would expect it to work.
Could anyone give me a suggestion on how to fix this or at least help me clear up what is going on there, please?
Thank you.
Sincerely.

댓글 수: 6

Could you post some snippets of how the functions are being called from the MATLAB function block?
Hi,
Thanks for getting back to me.
I have the code of the matlab function block:
function [out1, out2] = fcn_Simulink(t,y,array1, array2, array3, array4) ... %body ... %In the end I call a matlab function
y1 = fcnMatlab(t,y,classdef1, classdef2, classdef3) %Within this function I am calling several other matlab functions like x1 = fcn1('char1','char2', double, double) and so on. The errors sre in these last functions.
Hope I made myself clear.
Thank you.
Sincerely.
post all the content of your function
There is nothing much to add. The content of the function is independent calculations.
Although an input from Simulink will further define a character variable to be used as input argument in a Matlab function.
I will not post the code, just the sketch since the problem rely on calling these functions which the input arguments are character variables.
function [out1, out2] = fcn_Simulink(t,y,array1, array2, array3, array4)
%... body ...
y1 = fcnMatlab(t,y,classdef1, classdef2, classdef3)
out1 = y1;
out2 = somethingelse;
%end of function
function y = fcnMatlab(t,y,classdef1, classdef2, classdef3)
x1 = fcnProblem(charVar, classdef1.charVar1, double, double); %<-Problem
%... body ...%
%end of function
Thank you all. This problem was solved. Best.
How did you solve the problem?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

제품

질문:

2012년 10월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by