1

I have a C program on Linux Fedora 14, and now I am trying to remotely running it from a different PC using MATLAB via telnet. But right now all I can do is calling putty from matlab to access Linux terminal, and run the program through this remote terminal. But it is useless for me because I can't automate the matlab script to call the program repeatedly, and read some value back.

To illustrate my situation. Say I have a program Hello as following:

   void main (int argc, char* argv){
       if(argc > 0){
          printf("Hello %s \n", argv);
          printf("result is %d", argc++);
       }
      return;
   }

I want to have a MATLAB script that can run this program from a remote PC and input a name and read the result multiple times. But now all I have is calling system('C:\Putty\putty.exe <ip_address> -username -password') from matlab and get the remote terminal on Linux, then manually run ./hello <name>. How can I run the whole program from matlab directly through telnet (with or without putty, doesn't matter), and get the response from telnet?

Thanks.

3
  • stackoverflow.com/questions/6147203/… Commented Feb 14, 2013 at 18:58
  • Thanks. But The problem with Putty is I can't read the value back in matlab to process it. My program not only process the data, it also need to return data for matlab. Commented Feb 14, 2013 at 19:26
  • well that's a new problem you didn't have on before. use plink... it does 2-way pipe Commented Feb 14, 2013 at 19:40

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.