converting numbers to characters in a matrix
Show older comments
So I have a matrix and I have to convert a column of numbers into words... the same word. How can I do it? Obviously I have to convert the matrix to a cell to add characters.
Answers (1)
Azzi Abdelmalek
on 20 May 2016
A=[1 2;3 4]
B=arrayfun(@num2str,A,'un',0)
5 Comments
victoria camilleri
on 20 May 2016
Azzi Abdelmalek
on 20 May 2016
To make things clear, post an example with the expected result
victoria camilleri
on 20 May 2016
Edited: Azzi Abdelmalek
on 20 May 2016
Azzi Abdelmalek
on 20 May 2016
A=[60 10 2
50 10 2
40 10 2
20 10 2]
out=num2cell(A)
out(:,3)={'word'}
victoria camilleri
on 20 May 2016
Categories
Find more on Numeric Types in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!