textread to save specific columns?

조회 수: 4 (최근 30일)
Matthew Covington
Matthew Covington 2019년 3월 4일
댓글: Bob Thompson 2019년 3월 4일
My professor wants us to textread to read specific columns, it is a matrix with 12 rows, 4 columns. However I do not know how to read specific values.
  댓글 수: 1
Bob Thompson
Bob Thompson 2019년 3월 4일
Most likely the best strategy is to read the entire thing and then store the values that you want. Suppose you have six columns of doubles and you want only the third one.
[~,~,C,~,~,~] = textread('myfile.txt','%d %d %d %d %d %d %d',N);
Where N is the number of rows.

댓글을 달려면 로그인하십시오.

답변 (0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by