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.

Sy Z
  • 441
  • 1
  • 5
  • 10
  • http://stackoverflow.com/questions/6147203/automating-running-command-on-linux-from-windows-using-putty – thang Feb 14 '13 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. – Sy Z Feb 14 '13 at 19:26
  • well that's a new problem you didn't have on before. use plink... it does 2-way pipe – thang Feb 14 '13 at 19:40

0 Answers0