function [ result ] = params2cell( struct_name, struct_vals )

fields = fieldnames(struct_vals);
nfields = numel(fields);

result = cell(2,0); %headers;values
for f=1:nfields
    
    field = fields{f};
    local_field = ['struct_vals.' field];
    full_field = [struct_name '.' field];
    val = eval(local_field);
    
    if(isstruct(val))                
        sub_result = params2cell(full_field,val);   
        result = [result,sub_result];
    else
        result = [result,{full_field;val}];
    end    
end
end

