I'm getting a new line (without adding \n) and an indented line when using the function input() (MATLAB Online)
Show older comments
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 Comments
Dyuman Joshi
on 11 Dec 2023
Edited: Dyuman Joshi
on 17 Jan 2024
Looks like an incostinent behaviour on MATLAB Online, as this does not happen on the MATLAB App (R2021a on Win 10)
You should contact technical support and report this - Contact Support
Israe
on 11 Dec 2023
Dyuman Joshi
on 12 Feb 2024
@Israe, did you contact Technical support?
What did they say? Is the issue resolved?
Accepted Answer
More Answers (0)
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!