MergeCell

版本 1.1.0.0 (1.8 KB) 作者: Diederick
Merges contents of multiple cell arrays into one big cell array, with expansion
332.0 次下载
更新时间 2012/2/2

查看许可证

MergeCell takes any number of cell vectors (contain the same datatype) and concatenates their contents into one big cellvector
Any signleton inputs are expanded as needed, these inputs can be 1x1 cells or the contained datatype itself

Example: To add some information about fit to plot legend, we'd wan't to append information about the fit to the line labels:

linelbls = {'line a','line b','line c'};
slope = [.9 1 4.2];
slopetxt= arrayfun(@(x) sprintf('%.3f',x),slope,'UniformOutput',false);

leglbls = MergeCell(linelbls,', slope: ',slopetxt);
% leglbls = MergeCell(linelbls,{', slope: '},slopetxt); would be equivalent

引用格式

Diederick (2024). MergeCell (https://www.mathworks.com/matlabcentral/fileexchange/29866-mergecell), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2010b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Data Type Conversion 的更多信息
标签 添加标签
致谢

启发作品: Yahoo! Finance Data Loader

Community Treasure Hunt

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

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

fixed some typos in the example

1.0.0.0