Info
此问题已关闭。 请重新打开它进行编辑或回答。
How can I convert a matrix to all numeric values which contains numeric and characters both?
1 次查看(过去 30 天)
显示 更早的评论
I have matrix containing both numerics and characters(actually NaNs) values both. How to convert this matrix so that it contains all the numeric values?Because I want to write this matrix to an excel sheet.
回答(1 个)
Rik
2018-8-9
If you want to replace the NaNs by 0, you can simply use this:
data(isnan(data))=0;
4 个评论
Rik
2018-8-12
If your variable data is a matrix that is not a logical, this code will not return a logical. What exact code are you using? Try to reduce it to a small piece of code I can run to replicate your issue.
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!