Skip to content
Snippets Groups Projects
Commit 9895377d authored by Cristian Galperti's avatar Cristian Galperti
Browse files

createstructfrombus works with logical signals

parent 80c9c258
No related branches found
No related tags found
No related merge requests found
......@@ -28,7 +28,16 @@ for ii=1:signalssize
% recursive call
out.(element.Name) = SCDconf_createstructfrombus(dd,busname);
else
try cast(1,element.DataType); catch ME; error('non-numeric type'); end
try
if ~strcmp(element.DataType,'boolean')
elementtype=element.DataType;
else
elementtype='logical'; % it seems that boolean isn't supported by cast
end
cast(1,elementtype);
catch ME
error('non-numeric type');
end
elementdims=element.Dimensions;
switch numel(elementdims)
case 1
......@@ -39,7 +48,7 @@ for ii=1:signalssize
error('Not supported data structure');
end
out.(element.Name) = ...
timeseries(cast(data,element.DataType),[0;1],'Name',element.Name);
timeseries(cast(data,elementtype),[0;1],'Name',element.Name);
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