converting numbers to characters in a matrix

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)

A=[1 2;3 4]
B=arrayfun(@num2str,A,'un',0)

5 Comments

I don't get you what suggested...
To make things clear, post an example with the expected result
I have matrix A
60 10 2
50 10 2
40 10 2
20 10 2
and want to change the last column with the twos to a word say "love"
A=[60 10 2
50 10 2
40 10 2
20 10 2]
out=num2cell(A)
out(:,3)={'word'}

Sign in to comment.

Categories

Products

Tags

Asked:

on 20 May 2016

Community Treasure Hunt

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

Start Hunting!