cell2char

Function to convert a cell array of strings into a character array.
1.6K Downloads
Updated 16 Jun 2010

View License

function S = cell2char(C)
%
% Converts the contents of a cell array of strings into a character
% array. The contents of the cell C are read element-wise and
% converted into a char array of length MAXCOL where MAXCOL is
% the length of the longest string inside the array.
% Thus the dimensions of the resulting character array S are
% [NROW, MAXCOL], with NROW being the number of strings in C.
% Strings inside the array that are of shorter length than
% MAXCOL, are padded with blank spaces, so that S has an homogeneous
% number of columns. In addition, any rows in C that are NaN's
% in IEEE arithmetic representation are replaced by the string
% 'NaN'.
%
% Syntax: S = CELL2CHAR(C);

Cite As

Tonatiuh Pena Centeno (2024). cell2char (https://www.mathworks.com/matlabcentral/fileexchange/27910-cell2char), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R12
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Cell Arrays in Help Center and MATLAB Answers
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.0.0.0