I would like to read from a text file. But i need to be able to skip a certain number of rows, read some data skip more rows and read some data and so on. thank you

2 件のコメント

Mazen Arafeh
Mazen Arafeh 2011 年 7 月 25 日
1. The file i have is made of charecters and floating number.
2. How can i skip lines?
Walter Roberson
Walter Roberson 2011 年 7 月 25 日
Please do not open duplicate Questions; it only leads to duplication of effort.

サインインしてコメントする。

回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2011 年 7 月 25 日

0 投票

There are many ways. You can use textscan() to read line by line so you can skip any line you want.
If the file is not huge, you can read it once. Doing the skip in MATLAB matrix is much easier.
A easy try is to use the impordata() function.
a=importdata('MyDataFile.txt')

製品

タグ

質問済み:

2011 年 7 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by