-
Notifications
You must be signed in to change notification settings - Fork 184
Moving MATLAB Functions from Simulink to m files #654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jtgrasb thanks for working on this, this will really help us manage the WEC-Sim library. A few requested revisions:
- save the WEC-Sim library as 2019b, the current version we support
- also, when saving the library, save it at the top level, the default is for the library to open up to the level it's saved from
All tests are passing, so the revisions appear to work, but I cannot view the library until it's re-saved. Thanks!
|
@kmruehl Thanks for the suggestions! I updated those 2 things and also changed the name of 2 function folders after discussing with Adam. Let me know if you find any other issues. |
|
@jtgrasb it looks like the WEC-Sim library is saved in 2021a. We have a bit of a strange workflow for how to save the library that I hope to fix with sub-libraries. But you'll have to open the library and save it as a prior version, as 2019b. DISREGARD above comment I had an issue when I pulled your fork. I'll review this tomorrow. |
kmruehl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jtgrasb this is great, thank you! I just had a few minor comments:
- Can we remove some of the output initialization so that we are just calling the function from a script? I've highlighted a few examples of Simulink blocks where the outputs are initialized prior to calling the function. If not, that's alright
- Please remove inline comments meant for debugging. Before those were buried in the Library so we couldn't see them as easily, but now that the functions are tracked as separate
*.mfiles we should remove superfluous comments.
Thank you!
|
@kmruehl I've removed all the unnecessary comments and initializations as requested, except for the non-linear yaw cases as explained above. |
kmruehl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jtgrasb thank you so much, this is great and all tests passed on my end, so I'll go ahead and merge your PR.
* body element sublibrary * frames sublibrary * constraints sublibrary * moorings sublibrary * ptos sublibrary * resolving broken links in body elements * adding SimulinkModelFunctions * cleaning up the library * removing 2020a test from CI * resolving missing Simulink Function and displaying library links

I went through and found all MATLAB function blocks within the WEC-Sim blocks and changed them to call an m file of the same name that completed the desired function. I located all of these functions within a new folder called "FunctionsCalledbySimBlocks" within the sources/functions directory. This will allow for easier access to the functions as well as better tracking of their changes.