cell2vars: Transform cell to vars

版本 1.2.0.0 (2.0 KB) 作者: Renwen Lin
cell2vars: Transform cell's columns' to variables in workplace
334.0 次下载
更新时间 2012/10/8

查看许可证

% PURPOSE: Convert the cell's columns' to variables in matlab workspace
% -----------------------------------------------------------------------------
% SYNTAX:
% (1) cell2vars(cellvar)
% (2) cell2vars(cellvar, newvarname)
% -----------------------------------------------------------------------------
% OUTPUT:
% (1) each column of the cell is been transform to a variable in matlab
% workspace
% -----------------------------------------------------------------------
% INPUT:
% (1) cellvar: NxM --->a cell containing M columns. Each column include
% a head and its body.
% (2) newvarname: 1xM ---> M string as new head for the column.
% NB: no string can be include in the file.

% -----------------------------------------------------------------------
% LIBRARY:
% -----------------------------------------------------------------------
% SEE ALSO: vars2cell,
% -----------------------------------------------------------------------
% REFERENCE: assigni, eval
% -----------------------------------------------------------------------
% written by:
% Lin Renwen
% <linrenwen@gmail.com>

% Version 1.0 [2012-6-27 20:29:25]

%=============================================
% EXAMPLE:
% INPUT:
% > A = {'name','grade'; 1,56; 2,78; NaN,90};
% > cell2vars(A);
% > name
% name =
% 1
% 2
% NaN
%
% > grade
% grade =
% 56
% 78
% 90
% % END OF EXAMPLE
%=============================================

引用格式

Renwen Lin (2024). cell2vars: Transform cell to vars (https://www.mathworks.com/matlabcentral/fileexchange/37290-cell2vars-transform-cell-to-vars), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2011b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Structures 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.2.0.0

Revise the example; thanks so much! Simon

1.1.0.0

Adjust according to Jan Simon's suggestion. Jan thanks so much!

1.0.0.0