• greencv

    @whale-av
    Of course, I'll see what I get when trying to send arrays or more than one number at a time and try to see if I can split the results in pd...

    I will post how it goes, in here

    posted in technical issues read more
  • greencv

    Yes, EOF means "End Of File" so it is the Puredata console telling you that the communication is over.

    posted in technical issues read more
  • greencv

    Updates:

    I was now able to figure out how to send real time float numbers from matlab to puredata.

    Because puredata needs to be told which kind of atom it is receiving, (in this case float), In matlab you need to use the functon "sprintf" to send a variable with a stored number inside a string and still be able to tell puredata that the variable is a float.

    Also, pd needs to know when the message is over, so in matlab you need to put a semicolon at the end of the string.. Here is the code that worked:
    In matlab:
    clc;
    tcpipClient = tcpip('127.0.0.1',3000);
    set(tcpipClient,'Timeout',30);
    fopen(tcpipClient);
    a=rand;
    % b=num2str(a)+';';
    fwrite(tcpipClient,sprintf('float %f;', a));
    fclose(tcpipClient);

    This sends a random number from matlab to pd

    posted in technical issues read more
  • greencv

    @whale-av
    I see, then I will see the file formats and try what you suggest.
    Awesome, I will reveiw both links, thank you really much for all the help!

    Carlos

    posted in technical issues read more
  • greencv

    @whale-av
    Hello David,

    Yes, you are right! I didn't notice that Pd wasn't able to tell when the message was ending... that appeared to be the problem because now it is working perfectly when I send strings from matlab to pd.

    However when I try to send a number from matlab and display it in a number box in pd, it doesn't seem to do anything, I will keep on reading about data type compatibility between the two softwares, perhaps it is related to that...

    Thank you really much for the help with the string message!

    posted in technical issues read more
  • greencv

    Hello, I have been searching for protocols to communicate matlab and puredata for transfering information using matlab as a client and puredata as a server. I created a matlab code that sends a message to puredata but at the puredata end, I can stablish the connection (I debugged it using a number box) but I am not able to print matlab's message on the editor.
    I saw these threads but it didn't work either:
    https://forum.pdpatchrepo.info/topic/11188/eof-on-socket-using-netreceive-raspberry-pi
    https://stackoverflow.com/questions/17077364/communicating-between-pure-data-and-matlab-using-osc

    Here is my matlab code:
    clear all;
    clc;
    tcpipClient = tcpip('127.0.0.1',55002);
    set(tcpipClient,'Timeout',30);
    fopen(tcpipClient);
    fwrite(tcpipClient,'hi, i am matlab');
    pause(10);
    fclose(tcpipClient);

    tcpfailed.JPG

    posted in technical issues read more

Internal error.

Oops! Looks like something went wrong!