How to get a matrix into matLab from a txt file

4 views (last 30 days)
I have .txt file with lot of data, tex and numbers. When I open the .txt on matLab i get 63630 lines. Starting arround line 1200 until 63630 I have a matriz on that file. Using that matrix I have to create a image.
To create the image I've done this:
image(matriz,'CDataMapping','scaled'); colormap(gray);
but I'm not able to define the variable 'matriz' from the .txt file, can someone explain me how I can choose and say to matLab that those specific line are suposed to be a matrix?
  2 Comments
Walter Roberson
Walter Roberson on 6 Dec 2012
The lines that you do want, what format are they, and which parts of them do you want read in as data?
Jan
Jan on 6 Dec 2012
A summary: You want to import the lines 1200 to 63630 from a text file to a matrix. Correct? Please post one of these lines, wuch that we can see the format.
What have you tried so far and which problems occurred?

Sign in to comment.

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!