# I am working on a program in matlab for my final project.

1. Apr 17, 2007

### giritrobbins

I am working on a program in matlab for my final project. I am importing six large files with textscan. I have a couple of questions, is there a way to work with filenames dynamically. All my filenames are in the form of
Code (Text):
T$#K.txt. My second question has to deal with textscan. I know you need to use this function to open a text file with column headers. When it imports the data it puts one column into one cell of an array and the second column into the second cell so that the addresses are Code (Text): T$#{1,1} and T###{1,2}.
I am not sure but I think the arguments I am using is causing this. Is there a way to have this go into a a normal array that I could reference normally like T200{#,#).

"T200=textscan(fid, '%n %n','Headerlines',1);"

My third question is I know you can have strings in arrays but can you store and call filenames and or variables out of matrix. I know you can store filename.txt but I am not sure of how one would go about using this, if I could call a variable or filename from a array it would cut my program down quite a bit since it is mostly hard coded.

And a quick throwback to question two would T200=[T200{1,1},T200{1,2}] work in creating one array or is it just going to combine those two cells?

Last edited by a moderator: Mar 12, 2013
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted