Mercurial > repos > public > sbplib
view dealStruct.m @ 1333:0aefcb30cab4 feature/D2_boundary_opt
Add support for RK6
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Sat, 07 May 2022 10:30:59 +0200 |
parents | b7ec26da3d77 |
children |
line wrap: on
line source
function varargout = dealStruct(s, fields) default_arg('fields', []); if isempty(fields) out = dealFields(s, fieldnames(s)); varargout = out(1:nargout); else assert(nargout == length(fields), 'Number of output arguements must match the number of fieldnames provided'); varargout = dealFields(s, fields); end end function out = dealFields(s, fields) out = cell(1, length(fields)); for i = 1:length(fields) out{i} = s.(fields{i}); end end