Search Comments and Ratings

go

Comments and Ratings

   
Date File Comment by Comment Rating
07 Sep 2009 The Matlab code for absorption coefficient in underwater wireless communication networks This code helps to find the absorption coefficient values for a particular frequency range. Author: SUSAN Thomson, Rodney

24 Mar 2009 TCP/IP Socket Communications in MATLAB A simple example TCP/IP server and client Author: Rodney Thomson Thomson, Rodney

Hi Maurizio,

Unfortunately the read(byte []) method will not work directly from within MATLAB. My thoughts as to why:

When you execute:
  data = zeros(1, 100, 'char');
  data_input_stream.read(data, 0, 100);
It supplies a COPY of the data array which would be populated. Unfortunately you don't have access to this. This requires pass-by-reference semantics which I don't think MATLAB currently support.

To get around this issue personally I've created helper Java classes to read blocks of data and RETURN the Byte array. This requires creating Java classes and compiling them.

Email me if you want some examples.

Rod
  

 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com