Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Level 2 S Function with m-file

Status
Not open for further replies.

kalkuel

Aerospace
Sep 4, 2006
2
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...
 
Replies continue below

Recommended for you

Kalkuel,
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
 
I do not know why, but now the input into my S-function works with multiplexing real double signals and passing to the S-function.
The next error that occurs is:

Error converting from MATLAB array to Simulink data
 
kalkuel,

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor