From my understanding, you want to read the data from the server using the fopen().
fopen() is used to open a file or to obtain any file information. It expects a filename or a file identifier as its input. Since here you are passing a tcp client properties object to the fopen(), it is throwing that error you mentioned.
A tcpclient properties object looks something like below:
t = tcpclient("www.mathworks.com",80)
tcpclient with properties:
Show all properties, functions
So this object cannot be used along with fopen().
You may use read() by passing the tcp client properties object to read the data.
An example of it can be found in this documentation link: