필터 지우기
필터 지우기

why fread showing too many output arguments?

조회 수: 3 (최근 30일)
MP
MP 2023년 4월 5일
댓글: MP 2023년 4월 6일
I have a function which reads a binary file and extracts the data. I already have entire code. I am trying to run it, but it shows error at
[nmass, nr, np, nk, nm] = fread(id, 5, 'int');
Error using fread
Too many output arguments.
I have a 5D binary data file and trying to extract the data from that file.
Any suggestions, why it is stuck at this point?
Thank you in advance.
  댓글 수: 2
Stephen23
Stephen23 2023년 4월 5일
"Any suggestions, why it is stuck at this point?"
As the FREAD documentation explains, FREAD returns all of the data in its first output:
The second output (the number of characters read) is not commonly used. In any case, it certainly does not support five output arguments as you show.
MP
MP 2023년 4월 5일
Aha! I did that trial an error before.
I get 5-values when I run:
[nmass] = fread(id, 5, 'int');
So, does that mean 5-values represents 5-different parameters?

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

채택된 답변

Stephen23
Stephen23 2023년 4월 5일
이동: Rik 2023년 4월 5일
"So, does that mean 5-values represents 5-different parameters?"
Yes, if that is what your file contains and the FREAD command is correctly specified for importing that file data.
  댓글 수: 4
Rik
Rik 2023년 4월 5일
I moved the comments so the answer can be excepted.
MP
MP 2023년 4월 6일
Thank you Rik

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by