필터 지우기
필터 지우기

How to have simple text in a matrix

조회 수: 13 (최근 30일)
Michael
Michael 2011년 6월 14일
Hey, so I have a function that I want to automatically load multiple files that are loaded to a certain folder. I'm using a fileID function in a loop to load all of the files with a specific type of file name.
I can't really go into the complicated specifics, but basically is there any way for me to make a matrix out of text?
I tried just doing A = ['text1'; 'text2';...etc]; but that just separates all the letters. I want to be able to say A(1) and for it to spit out "'text1'", not just "text1"...
Thanks!

채택된 답변

Sean de Wolski
Sean de Wolski 2011년 6월 14일
A = {'text1','text2','Hello World','Happy Birthday'}
A{1}
You need cell arrays
doc cell
for more info

추가 답변 (1개)

Chirag Gupta
Chirag Gupta 2011년 6월 14일
Use cells
A ={'text1','text2'};
A(1)
ans =
'text1'

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by