I’m getting a new line (without adding n) and an indented line when using the function input() (MATLAB Online)
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?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? 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? input, n, matlab online MATLAB Answers — New Questions