0 Replies - 3956 Views - Last Post: 01 November 2011 - 07:49 PM Rate Topic: -----

#1 chromeman605  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 28-August 09

Matlab loading specific data from text file

Posted 01 November 2011 - 07:49 PM

Hello, I am trying to read in data from a text file into Matlab so I can do some manipulations with the numbers. Specifically, there are two arrays of interest in the text file; one is wavelengths and the other is amplitudes. I would like to store just the array of numbers (once I find them) into two separate variables. So my questions are:

How do I find keywords in the text file (ie Wavelengths) so I can know to store after that?
When I find the keywords, how do I only get that array of numbers before until it gets to the next word (ie next array)?

So far I have only read in the file as shown below:

clear all
FILE = textread('merge.txt','%s','delimiter','\n')

I have been exploring 'textread', 'textscan', and numerous other methods to read this in separately. The code above currently only loads everything.

Any help would be greatly appreciated!

Is This A Good Question/Topic? 0
  • +

Page 1 of 1