Run telnet with cmd in MATLAB command window

조회 수: 21 (최근 30일)
Martin
Martin 2011년 6월 29일
답변: Gregor Dempke 2019년 10월 19일
Hey, I have some trouble with using the command interface in MATLAB.
When I run system('cmd'), the command prompt starts and is displayed in the matlab command window. When I now type telnet at the cursor position in my matlab command window, it does not know the command 'telnet'. When I start telnet in the normal windows command window without any matlab stuff, everything works fine with that command.
What can be wrong with that?
Thanks, Martin

채택된 답변

Jason Ross
Jason Ross 2011년 7월 1일
I think I figured out what is going on. The "telnet" client seems to set up some sort of terminal environment, which doesn't play well with the way that the MATLAB command window is working. If I try the following, nothing useful happens.
>> system('cmd')
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
c:\Temp>telnet
telnet
If I get what you are trying to do, I believe you need to use the "plink" command, which is part of the PuTTY suite, which is freely available (google "download putty"). When I use that, I get a usable prompt:
>> system('cmd')
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
c:\Temp>"c:\program files (x86)\putty\plink.exe" -telnet myunixhost
"c:\program files (x86)\putty\plink.exe" -telnet myunixhost
myunixhost login: <enter my login here>
Password: <enter password>
  댓글 수: 2
Martin
Martin 2011년 7월 6일
Sorry for my late reply, but thanks very much! I still use Putty and that command is perfect for me.
Jason Ross
Jason Ross 2011년 7월 6일
No problem, glad it worked for you!

댓글을 달려면 로그인하십시오.

추가 답변 (3개)

Walter Roberson
Walter Roberson 2011년 6월 29일
MATLAB has set the PATH environment variable differently than you are expecting.
echo $PATH
You can set the PATH inside of MATLAB by using setenv('PATH',newpath)

Martin
Martin 2011년 6월 30일
I do not really understand what you mean with that. Can you explain it a little bit and maybe add some code, that I should use to run telnet in MATLAB? Telnet is located at folder C:\Windows\system32
When I use the normal command window, the path must not be specified. I just type "telnet" and then it runs telnet, not depending on which path I am right now.
I hope you can help me out.
Martin
  댓글 수: 1
Walter Roberson
Walter Roberson 2011년 6월 30일
Sorry, I will be busy today and will not have time to explain; someone else should be able to assist you.

댓글을 달려면 로그인하십시오.


Gregor Dempke
Gregor Dempke 2019년 10월 19일
cmd

카테고리

Help CenterFile Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by