Cell 'Find And Replace'

版本 1.0.0.0 (734 字节) 作者: Yoav Mor
Finds all occurrences of NaN in a cell array and replaces them.
3.2K 次下载
更新时间 2006/4/26

无许可证

cellData=cellNaNReplace (cellData, replaceWith)

Accepts a cell array and a char/integer and replaces all occurrences of NaN in that cell array with the 'replaceWith' value. This is especially useful when using 'readfromexcel' or other excel importers since they sometimes put NaN instead of empty cells.

Example of usage:
a = num2cell([0 1 2 NaN 4]);
b = cellNaNReplace (a,'');

or, if you're dealing with excel spreadsheets, you can use:

Data = readfromexcel(File,'All');
Data = cellNaNReplace (Data,0);

Enjoy.

引用格式

Yoav Mor (2024). Cell 'Find And Replace' (https://www.mathworks.com/matlabcentral/fileexchange/10847-cell-find-and-replace), MATLAB Central File Exchange. 检索来源 .

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

参考作品: readfromexcel

Community Treasure Hunt

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

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