Search and replace values in cell array?
13 次查看(过去 30 天)
显示 更早的评论
I have a cell array that is populated with 0's and letters. I and trying to write a script that will convert the different letters into different numerical values. The array is set up as below;
0 0 0 0 M
0 0 0 0 0
0 S 0 0 0
0 0 L 0 0
And i am trying to convert it to;
0 0 0 0 2
0 0 0 0 0
0 1 0 0 0
0 0 3 0 0
I can't search each column/row and replace manually as I will have an unknown amount of each. I tried using cellfun for this but as the isn't scalar I wasn't sure how. Any suggestions?
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Cell Arrays 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
