If you're already set up with the Matlab OceanEdGE Toolbox, run the following command to access cloud-based data and metadata relating to you target model :
% Access the OceanEdGE cloud API
oceanedge = Oceanedge("model_name");
To specify the incident waves we can define a new Waves object :
% Define incident wave conditions
waves = Waves("PM", Tp=2, Hm0=0.25); % Pierson-Moskowitz spectrum
... and specify the duratrion and resolution of the input waves excitation timeseries :
% User specified time vector
oceanedge.settings_TD.sim_duration = 200; % sec
oceanedge.settings_TD.sampling_time = 0.1; % sec
Finally, to prepare the Matlab workspace for Simulink, type :
% Prepare Simulink workspace
oceanedge = oceanedge.prepare_sim(waves);
Upon running this line, Matlab looks to see if there are any pre-existing .slx files within the
present directory (it's okay to start with an empty directory). If there are no .slx files, Matlab
will open and save a copy of the master Simulink model as shipped with the OceanEdge Toolbox. This can be used
as a template for your controller design.
You'll need one file download and two lines of code to set up OceanEdGE (you also need an OceanEdGE login profile, but you've already set this up!)
The Matlab OceanEdGE Toolbox package can be downloaded here. Place this anywhere in your environment (it can remain in 'Downloads'), double click, and delete this file once Matlab finishes the installation process. Please take note of the toolbox version, to ensure your system is up-to-date in the future.
The OceanEdGE API requires authentication (this key should be kept secret). Enter the following two lines of code in Matlab to save your profile (email address) and API key to your local environment:
setenv("oceanedge_api_user","")
setenv("oceanedge_api_key","")
You only need to run this once for your Matlab installation. However, your Matlab and OS sessions may need a
restart in order to save these environment variables going forward. You can repeat this step on your next Matlab
session if you have any issues.