Skip to content

Commit

Permalink
MEX: convert Matlab strings to char arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
FreyJo committed Jul 30, 2021
1 parent 4a3100a commit 50ece74
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 5 additions & 4 deletions interfaces/acados_matlab_octave/acados_ocp_opts.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
%

classdef acados_ocp_opts < handle



properties
Expand All @@ -42,7 +41,6 @@


methods


function obj = acados_ocp_opts()
% model stuct
Expand Down Expand Up @@ -104,6 +102,11 @@


function obj = set(obj, field, value)
% convert Matlab strings to char arrays
if isstring(value)
value = char(value);
end

if (strcmp(field, 'compile_interface'))
obj.opts_struct.compile_interface = value;
elseif (strcmp(field, 'codgen_model'))
Expand Down Expand Up @@ -212,9 +215,7 @@
end
end


end % methods



end % class
5 changes: 5 additions & 0 deletions interfaces/acados_matlab_octave/acados_sim_opts.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@


function obj = set(obj, field, value)
% convert Matlab strings to char arrays
if isstring(value)
value = char(value);
end

if (strcmp(field, 'compile_interface'))
obj.opts_struct.compile_interface = value;
elseif (strcmp(field, 'codgen_model'))
Expand Down

0 comments on commit 50ece74

Please sign in to comment.