a matrix of strings

10 views (last 30 days)
som
som on 30 Jan 2012
Hi all
I want to make a 3-by-3 matrix with the elements of strings.
for example: a=[ok ok ok; no no no ;ok ok ok ];
How can I do it?
thanks,

Accepted Answer

Andrei Bobrov
Andrei Bobrov on 30 Jan 2012
use cell array
b = {'ok' 'no'}
a = b([1;2;1]*ones(1,3))

More Answers (0)

Categories

Find more on Characters and Strings in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!