Click to See Complete Forum and Search --> : cell arrays in matlab


sravan2003_2003
September 13th, 2004, 09:33 AM
Hi all,

Can anyone explain me the concept of cell arrays in Matlab.

I have used the following statement for selecting multiple files


[FileName,PathName,FilterIndex] = uigetfile('*.*','Use Ctrl or Shift key to select multiple files:','multiselect','on')
FileName

I have seen the contents of FileName which is a cell array but i could not understand how these filenames are stored

FileName =

Columns 1 through 2

'2345-158-470_FILE' '2345-109-225_FILE'

Columns 3 through 4

'2345-110-230_FILE' '2345-111-235_FILE'

Columns 5 through 6

'2345-112-240_FILE' '2345-113-245_FILE'

Columns 7 through 8

'2345-114-250_FILE' '2345-115-255_FILE'

Columns 9 through 10

'2345-116-260_FILE' '2345-117-265_FILE'

Columns 11 through 12

'2345-118-270_FILE'


I want to store all these filenames in an array?Can anyone explain?

Thanks for your time and consideration.

Regards,
Sravan

yiannakop
September 13th, 2004, 11:30 AM
It is probably an array of strings. The array consists of 12 element and each element is a string (the fileName). So filename(1) is the first fileName.
What matlab edition do u use? I run this command in matlab 6.5 and it is incorrect.

sravan2003_2003
September 14th, 2004, 01:59 AM
Hi,

Thanks for the reply.
Yesterday after fighting with the code for sometime,i understood how a string is stored.The filename(string) is stored in a two dimensional array.

The first filename is stored like this FileName{1,1},second one FileName{1,2} third one FileName{1,3} and so on.

I use Matlab 7.0

Regards,
Sravan

yiannakop
September 14th, 2004, 09:53 AM
Hi,
....
The first filename is stored like this FileName{1,1},second one FileName{1,2} third one FileName{1,3} and so on.
....

This is a one dimensional array of string, which means a two dimensional array of charecters.