Hello,
I try to use the matlab toolbox in order to call OpenFast from MATLAB.
First, I run the example (I have changed the path of openfast.exe & the .fst file) but it gives me an error.
The figure below shows the error i obtain.
Does anyone encounter the same problem ?
Best Regards,
Riad
Dear @Riad.Elhamoud,
I donāt see that youāve shared the code you are using to call OpenFAST from MATLAB; please clarify.
Best regards,
1 Like
Dear @Jason.Jonkman ,
Thank you for your reply. You can find below the code that i am using (i put the code in bold and sorry it is messy: it contains a lot of comments):
**%% Documentation **
% Example script to run a set of FAST simulations using FAST exe.
%
**% NOTE: This script is only an example. **
% The example data is suitable for a given version of OpenFAST and might need to be adapted
**% **
% Adapt this script to your need, by calling the different subfunctions presented.
%
%% Initialization
restoredefaultpath;
addpath(genpath(āC:\Users\1oRs5\Desktop\these_dr_rabih\thĆØse_dr_rabih\MDOF_calcul\matlab-openfast-toolbox\matlab-toolbox-main\Utilitiesā)); % TODO adapt me
%% Parameters
FASTexe=āC:\Users\1oRs5\Desktop\openfast\openfast_x64.exeā;
% FASTexe = āā¦/ā¦/_ExampleData/openfast3.0_x64s.exeā; % path to an OpenFAST executable
OUText = ā.outbā; % Output extension
FSTfilenames=āC:\Users\1oRs5\Desktop\openfast\r-test-061441958a2eef7f494d69ee097f8ec050d5a129\glue-codes\openfast\5MW_OC3Spar_DLL_WTurb_WavesIrr\5MW_OC3Spar_DLL_WTurb_WavesIrr.fstā;
% FSTfilenames={ % path to OpenFAST input files
% āā¦/ā¦/_ExampleData/5MW_Land_Simulations/Main_5MW_Land_8mps.fstā,
% āā¦/ā¦/_ExampleData/5MW_Land_Simulations/Main_5MW_Land_10mps.fstā,
% };
**%% Run FAST an all fst files **
runFAST(FSTfilenames, FASTexe); %, āflagā,ā-VTKLinā);
%% List of output files
OUTfilenames = cellfun(@(s)strrep(s,ā.fstā,OUText), FSTfilenames, āUniformOutputā,false);
for i = 1:length(OUTfilenames)
** if ~exist(OUTfilenames{i},āfileā)**
** warning(āSimulation failed: %sā, FSTfilenames{i})**
** end**
end
Best Regards,
Riad
Try putting your input filename in a cell array, i.e.:
FSTfilenames={āC:\Users\1oRs5\Desktop\openfast\r-test-061441958a2eef7f494d69ee097f8ec050d5a129\glue-codes\openfast\5MW_OC3Spar_DLL_WTurb_WavesIrr\5MW_OC3Spar_DLL_WTurb_WavesIrr.fstā};
Best regards,
Thank you for your reply !
I tried your suggestion but unfortunately, it does not work 
I ran through Mathworks forums: i left FSTfilenames without brackets and i make changes in runCommands
I replace the commented expression by the expression right below (i add brackets). But, always, i have an error.
Best Regards,
Riad
To debug, you can remove the semicolon ;
from line 25 (where you set sCmd
) in the runCommands.m
function. It might be better to debug what commands are getting generated in runFAST.m
so that you can see what command and filenames are being sent to runCommands
.

However, I suspect the problem is that you have used double quotes " "
instead of single quotes ' '
in creating the cell array of FSTfilenames
. The double quotes creates a string object instead of a character array. (Notice that the example uses the form FSTfilenames={'ā¦/ā¦/_ExampleData/5MW_Land_Simulations/Main_5MW_Land_10mps.fst'}
1 Like