Level 2 S Function with m-file
Level 2 S Function with m-file
(OP)
Hallo,
can anybody tell me how to get a vector as input to a Level 2 S Function? It always says: Too many input arguments...
can anybody tell me how to get a vector as input to a Level 2 S Function? It always says: Too many input arguments...
RE: Level 2 S Function with m-file
This is a difficult question to answer because there are several things that could be wrong. The first is how exactly are you assembling the vector to pass to the s-function. This is important because if you are just passing three signals to a mux and then to the s-function then you are passing three individual variables on one signal path, which if you are only reading in one variable in the function call at the beginning of the m-file would create the error you are having.
The mux method is acceptable only if your s-function then combines them into one vector with in the m-file and then operates on it in that fashion.
I would suggest that you go to Mathworks and read the help files concerning passing information into s-functions.
or tell the forum what the signal being fed into the s-function is and how it was generated. Also it is necessary to know what variables your s-function is expecting in the signal.
I hope this helps.
BSK
RE: Level 2 S Function with m-file
The next error that occurs is:
Error converting from MATLAB array to Simulink data
RE: Level 2 S Function with m-file
That error you are getting might have to do with the array that you are passing out of the s-function.
The workspace that the s-function works in and the one for the simulink simulation are different.
I would check what variable type you are passing out of the s-function and how many signals it is being broken into.
When you said multiplexing do you mean passing the signals to a mux before passing them in to the s-function?
Not knowing what our model looks like in the location of the error makes it difficult to give a direct answer.
BSK