Hi all I am trying to send data from matlab to c. In order to do so I am using the function fwrite.
My question is : how to send it as an struct ? for example
Msg.Size = int32(8);Msg.Data = '12345678'; t = tcpip('10.1.4.34');set(t, 'RemotePort', 55555)set(t, 'InputBufferSize', 30000)fopen(t)
It works OK When I execute the following
fwrite(t,Msg.Size,'int32');fwrite(t,Msg.Data,'char');
How can I send the whole struct Msg ?
Any help will be appreciated.
Best Answer