The stream is already closed

Post Reply
matlab1
Site Admin
Posts: 4797
Joined: Thu Dec 15, 2016 9:30 am
Contact:

The stream is already closed

Post by matlab1 »

The stream is already closed
matlab1
Site Admin
Posts: 4797
Joined: Thu Dec 15, 2016 9:30 am
Contact:

Re: The stream is already closed

Post by matlab1 »

Solution:

When you close a strem and try to open it again, you will see this error.

So check previous lines of your MATLAB code.

For more information,

A = fread(fileID) reads data from an open binary file into column vector A and positions the file pointer at the end-of-file marker. The binary file is indicated by the file identifier, fileID. Use fopen to open the file and obtain the fileID value. When you finish reading, close the file by calling fclose(fileID).



fwrite(fileID,A) writes the elements of array A as 8-bit unsigned integers to a binary file in column order. The binary file is indicated by the file identifier, fileID. Use fopen to open the file and obtain the fileID value. When you finish writing, close the file by calling fclose(fileID).




https://www.mathworks.com/help/matlab/ref/fwrite.html

https://www.mathworks.com/help/matlab/ref/fread.html

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests