Mercurial > hg > ltpda
view m-toolbox/classes/+utils/@prog/fields2list.m @ 52:daf4eab1a51e database-connection-manager tip
Fix. Default password should be [] not an empty string
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 07 Dec 2011 17:29:47 +0100 |
parents | f0afece42f48 |
children |
line wrap: on
line source
function fnames = fields2list(fields) % FIELDS2LIST splits a string containing fields seperated by ',' % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % DESCRIPTION: FIELDS2LIST splits a string containing fields seperated by % ',' and returns a cell array. % % CALL: fnames = fields2list(fields) % % INPUTS: string - a string seperated by ',' % % OUTPUTS: fnames - cell array % % EXAMPLE: >> fields = 'field1, field2, field3, field4'; % >> ltpda_fields2list(fields) % ans = % 'field1' ' field2' ' field3' ' field4' % % VERSION: $Id: fields2list.m,v 1.1 2008/06/18 13:35:11 hewitson Exp $ % % HISTORY: 26-01-2007 M Hewitson % Creation % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% fnames = []; [f,r] = strtok(fields, ','); fnames = [fnames cellstr(f)]; while ~isempty(r) [f,r] = strtok(r, ','); fnames = [fnames cellstr(f)]; end % END