Importing and transposing a Text file

How would I go about both importing and transposing a text file... so far I have this
fileID= fopen('C:\Users\Owner\Matlab_code\data\')
C=textscan(filename, 'format', 'param')
I want it to read in all subjects and all conditions, so would I then put a for loop?
for s=1:15 for: c=1:4 end end

댓글 수: 1

Matt Tearle
Matt Tearle 2011년 2월 28일
Can you show the format of the file? What kind of structure do you want the imported & transposed data to have? A cell array where every cell is a single entry? Numeric?

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

답변 (1개)

Oleg Komarov
Oleg Komarov 2011년 2월 28일

0 개 추천

Give a look at Example 2 in textscan.
Also:
  1. Post the first 3-4 lines of the file you want to import
  2. fopen(...) should put the fullpath inside not only to the directory
Oleg

카테고리

도움말 센터 및 File Exchange에서 Large Files and Big Data에 대해 자세히 알아보기

질문:

Liz
2011년 2월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by