a matrix of strings

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,

 채택된 답변

Andrei Bobrov
Andrei Bobrov 2012년 1월 30일

0 개 추천

use cell array
b = {'ok' 'no'}
a = b([1;2;1]*ones(1,3))

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

질문:

som
2012년 1월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by