Skip to content
Snippets Groups Projects
Commit f06cf4c4 authored by Federico Felici's avatar Federico Felici
Browse files

Handle empty targetstruct

parent 5c995789
No related branches found
No related tags found
No related merge requests found
...@@ -221,13 +221,13 @@ classdef SCDclass_algo ...@@ -221,13 +221,13 @@ classdef SCDclass_algo
targetworkspace = 'global'; % default: global workspace (assigninGlobal) targetworkspace = 'global'; % default: global workspace (assigninGlobal)
end end
if ~iscell(targetstruct) if ~iscell(targetstruct) && ~isempty(targetstruct)
targetstruct = {targetstruct}; targetstruct = {targetstruct};
end end
if(~isempty(obj.stdinits)) if(~isempty(obj.stdinits))
for ii=1:numel(obj.stdinits) for ii=1:numel(obj.stdinits)
if contains(obj.stdinits{ii}{2},targetstruct) if ~isempty(targetstruct) && contains(obj.stdinits{ii}{2},targetstruct)
warning('SCDclass_algo:addfpinitfcn','A function defining the structure %s has already been added, ignoring.\d',targetstruct) warning('SCDclass_algo:addfpinitfcn','A function defining the structure %s has already been added, ignoring.\d',targetstruct)
return return
end end
...@@ -313,6 +313,9 @@ classdef SCDclass_algo ...@@ -313,6 +313,9 @@ classdef SCDclass_algo
sim(obj.modelname); sim(obj.modelname);
end end
function open(obj)
open(obj.modelname)
end
end end
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment