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.

Antworten (1)

Azzi Abdelmalek
Azzi Abdelmalek am 20 Mai 2016

0 Stimmen

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

5 Kommentare

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'}
thanks

Melden Sie sich an, um zu kommentieren.

Kategorien

Produkte

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by