MHKiT-Software / MHKiT-MATLAB

MHKiT-MATLAB provides the marine renewable energy (MRE) community tools for data processing, visualization, quality control, resource assessment, and device performance.
https://mhkit-software.github.io/MHKiT/
BSD 3-Clause "New" or "Revised" License
15 stars 23 forks source link

Example using WEC-Sim data with mhkit-matlab #36

Closed kmruehl closed 3 years ago

kmruehl commented 3 years ago

PR for MHKiT-MATLAB Example using WEC-Sim Data

This PR, but is for a MATLAB Live example to load WEC-Sim data and apply MHKiT functions. I did not make it a 1:1 to the MHKiT-Python WEC-Sim example since this example is largely using native MATLAB functions. But I did make it as close as possible for the examples provided. @rpauly18 This is ready for review.

rpauly18 commented 3 years ago

@kmruehl Thanks for pulling this together. I am curious what version of MATLAB you used to pull this together. When I run it, the data is not loading as it should. I get a warning that the data cannot be loaded as an object and is instead is read as a uint32, which is essentially useless. I am going to keep trying to mess around with how it is loaded.

Update: on MATLAB Answers I found the possible answer to the problem: "The second error is because a variable in the mat file is an object of class SVMLightingClassifier. For matlab to load that correctly, it needs to see the code of SVMLightingClassifier (as it was when the mat file was saved). In the absence of such code matlab can't reconstruct the object and therefore just give you a number instead (which is completely useless)." See the whole conversation here

If that is in fact the answer, we will need to show example data in the same format that is used in Python.

kmruehl commented 3 years ago

@rpauly18 that is very strange. I'm running this example in 2020a. Since this example includes a WEC-Sim output object, I went ahead and changed it to a structure. Hopefully this will resolve your issue. Also, we are considering making the default output of WEC-Sim a structure instead of an object anyway. That should solve the issue universally (for matlab and python). https://github.com/WEC-Sim/WEC-Sim/projects/37

kmruehl commented 3 years ago

@rpauly18 I'm glad that resolved the issue. I'm going to delete this branch now.