Extracting multiple data in a MATLAB matrix

  • #1
134
0
Hey everyone. I want to extract numerical data from files lets say g0001.txt to g0060.txt and store it in a matrix with each element is an array.
like this:
M=[g1() g2() g3() ................g60()]
matrix order can be 1 x 60 , i.e. to say 1 row and 60 columns and each element is an array which stores the entire data from g000n.txt. like i want data from g0001.txt in g1() and g0002.txt in g2() and so on.
Also later on i want plot each of these elements with respect to another array by accessing them each.
Each of these .txt files will have around 200 float values.
 

Answers and Replies

  • #2
kreil
Insights Author
Gold Member
668
68
If you want each set of data to be an element of a larger "thing", then you should put them into a cell array or structure (I prefer the former).

For info and the available functions for importing data from text files, check out this doc page:
http://www.mathworks.com/help/matlab/text-files.html
 

Related Threads on Extracting multiple data in a MATLAB matrix

  • Last Post
Replies
6
Views
23K
Replies
6
Views
7K
Replies
8
Views
3K
Replies
1
Views
8K
  • Last Post
Replies
2
Views
3K
  • Last Post
Replies
10
Views
3K
  • Last Post
Replies
1
Views
13K
Replies
1
Views
3K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
2
Views
8K
Top