Home > utility > cell2str.m

cell2str

PURPOSE ^

cellstr: Cell string to string conversion

SYNOPSIS ^

function string = cell2str(cellstr)

DESCRIPTION ^

 cellstr: Cell string to string conversion

    For example:
        x={'mon', 'tue', 'wed'};
        y=cell2str(x)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function string = cell2str(cellstr)
0002 % cellstr: Cell string to string conversion
0003 %
0004 %    For example:
0005 %        x={'mon', 'tue', 'wed'};
0006 %        y=cell2str(x)
0007 
0008 %    Roger Jang, 20010610, 20071009
0009 
0010 string = [];
0011 for i=1:length(cellstr),
0012     string = [string, '''', cellstr{i}, ''''];
0013     if i~=length(cellstr),
0014         string = [string, ', '];
0015     end
0016 end
0017 string = ['{', string, '}'];

Generated on Tue 01-Jun-2010 09:50:34 by m2html © 2003