S-Function Builder Outputs
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello everyone, i think my problem is pretty simple, but I just can't figure out the problem. I want to build a standard S-Function with the help of the S-Function Builder. I have 4 Inputs, 4 Parameters and 2 Outputs. I entered my Inputs and Parameters in the respective fields in the Sfun-Builder. My formula for the output look like this: Tho = (Pel + Mh * Thi * c + Ms * Tsi * c - (Ms * c * (sqrt(pow(CG,2) * pow(Ms,2) * pow(Pel,2) + 4 * CG * pow(Mh,2) * Ms * Pel * Thi * c + 4 * CG * pow(Mh,2) * Ms * Pel * c * k + ... (its pretty long but it goes on like the part i posted).
When i click on "Build" in the Sfun-Builder i get a lot of errors but they are mostly the same. All refering to the line with my formula. The errors are:
error C2296 '*' : illegal, left operand has type 'const real_T *'
error C2297 '*' : illegal, right operand has type 'const real_T *'
error C2440 'function' ; cannot convert from 'const real_T *' to double
warning C4024 'pow' : different types for formal and actual parameter 1
I get these errors all over again until the error count exceeds 100 and the compiling stops. I need this to run for an important work! So please help me out here =)
0 Kommentare
Akzeptierte Antwort
Titus Edelhofer
am 29 Nov. 2012
Hi,
please keep in mind, that Simulink (and S-Function Builder) assumes all signals to possibly be vector valued. Therefore, all inputs and outputs are arrays. You will need to write e.g. PEL[0] instead of PEL.
Titus
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Simulink Coder finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!