Home > utility > cellStr2mat.m

cellStr2mat

PURPOSE ^

cellstr: Cell string to string conversion

SYNOPSIS ^

function mat = cellStr2mat(cellStr)

DESCRIPTION ^

 cellstr: Cell string to string conversion

    For example:
        x={'12', '34', '-6'};
        y=cellStr2mat(x)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function mat = cellStr2mat(cellStr)
0002 % cellstr: Cell string to string conversion
0003 %
0004 %    For example:
0005 %        x={'12', '34', '-6'};
0006 %        y=cellStr2mat(x)
0007 
0008 %    Roger Jang, 20081021
0009 
0010 [m, n]=size(cellStr);
0011 mat=zeros(m, n);
0012 for i=1:m
0013     for j=1:n
0014         mat(i,j)=eval(cellStr{i,j});
0015     end
0016 end

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