필터 지우기
필터 지우기

I'm getting a new line (without adding \n) and an indented line when using the function input() (MATLAB Online)

조회 수: 7 (최근 30일)
Hello,
I have been trying to read the input from the user using the input function as shown below.
function open_webpage
url = input("Enter the url: ", "s");
while isempty(url)
fprintf("You didn't enter any url. Please try again.\n")
url = input("Enter the url: ", "s");
end
end
The function works fine so far. However, when I run it, I keep getting a new line when prompted to enter the URL as shown below. Also, I don't understand why is the text indented.
I even checked the documentation and it seems I did everything correctly. Am I missing something?
  댓글 수: 3
Israe
Israe 2023년 12월 11일
That's what I was indeed suspecting. Thank you for your help.
Dyuman Joshi
Dyuman Joshi 2024년 2월 12일
@Israe, did you contact Technical support?
What did they say? Is the issue resolved?

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

채택된 답변

prabhat kumar sharma
prabhat kumar sharma 2024년 1월 17일
Hi Israe,
I also reproduced this issue at my end and I found that there is an extra new line printed without using '\n' in matlab online while this behaviour is not in seen in matlab desktop app.
I'll recommend you to report this bug to Mathworks technical support.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by