필터 지우기
필터 지우기

fscanf

조회 수: 1 (최근 30일)
Tor Fredrik Hove
Tor Fredrik Hove 2011년 10월 28일
When i try to read a file, this one:
3.0000000e+000 4.0000000e+000 5.0000000e+000 4.0000000e+000 5.0000000e+000 6.0000000e+000 I get
>> fid=fopen('samematrix.mongiss', 'r')
fid =
4
>> fscanf(fid, '%f%f%f')
ans =
3
4
5
4
5
6
>>
I want to have rows made to columns as it says that fscanf will do.

채택된 답변

Wayne King
Wayne King 2011년 10월 28일
Hi Tor,
fid=fopen('samematrix.mongiss', 'r')
data = fscanf(fid,'%f');
  댓글 수: 1
Wayne King
Wayne King 2011년 10월 28일
It does return the row as a column

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Entering Commands에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by