Input command not showing the prompt until answer is put in the command window
Currently I am using Matlab online, and whenever I run an input command, it won’t show the prompt until I input an answer.
For example:
R = input("Input the Resistance in Ohms:n");
Imax = input("Input the upper limit of current (greater than 0, in amps) to plotn");
When I run my script, the command window is blank until I enter the answer. Once I input an answer, the command window displays the text that shouldve shown before my answer, and start working normally for any future input commands. To be more specific, i’ve added a picture of what happens. When I run the script above, my command window is blank, but once I input the number "5" as my answer, the "Input the Resistance in Ohms:" prompt will show up before my answer. Then the next input prompt will show up before I put in my answer as it should’ve done with the input command before.
I haven’t seen any similar issues online and I unfortunetly cannot try the dekstop version of MATLAB at the moment. Any help is appreciated!
In case anybody wants to see the whole section of code this is in
%Clearing command window and workspace
clc
clear
%Asking for inputs
R = input("Input the Resistance in Ohms:n");
Imax = input("Input the upper limit of current (greater than 0, in amps) to plotn");
%Creating 200 numeric values of current to plot
I = linspace(0,Imax,200);
%Solving for voltage (V)
V = R*I;
%Plotting voltage vs current
plot(I,V,"k-")Currently I am using Matlab online, and whenever I run an input command, it won’t show the prompt until I input an answer.
For example:
R = input("Input the Resistance in Ohms:n");
Imax = input("Input the upper limit of current (greater than 0, in amps) to plotn");
When I run my script, the command window is blank until I enter the answer. Once I input an answer, the command window displays the text that shouldve shown before my answer, and start working normally for any future input commands. To be more specific, i’ve added a picture of what happens. When I run the script above, my command window is blank, but once I input the number "5" as my answer, the "Input the Resistance in Ohms:" prompt will show up before my answer. Then the next input prompt will show up before I put in my answer as it should’ve done with the input command before.
I haven’t seen any similar issues online and I unfortunetly cannot try the dekstop version of MATLAB at the moment. Any help is appreciated!
In case anybody wants to see the whole section of code this is in
%Clearing command window and workspace
clc
clear
%Asking for inputs
R = input("Input the Resistance in Ohms:n");
Imax = input("Input the upper limit of current (greater than 0, in amps) to plotn");
%Creating 200 numeric values of current to plot
I = linspace(0,Imax,200);
%Solving for voltage (V)
V = R*I;
%Plotting voltage vs current
plot(I,V,"k-") Currently I am using Matlab online, and whenever I run an input command, it won’t show the prompt until I input an answer.
For example:
R = input("Input the Resistance in Ohms:n");
Imax = input("Input the upper limit of current (greater than 0, in amps) to plotn");
When I run my script, the command window is blank until I enter the answer. Once I input an answer, the command window displays the text that shouldve shown before my answer, and start working normally for any future input commands. To be more specific, i’ve added a picture of what happens. When I run the script above, my command window is blank, but once I input the number "5" as my answer, the "Input the Resistance in Ohms:" prompt will show up before my answer. Then the next input prompt will show up before I put in my answer as it should’ve done with the input command before.
I haven’t seen any similar issues online and I unfortunetly cannot try the dekstop version of MATLAB at the moment. Any help is appreciated!
In case anybody wants to see the whole section of code this is in
%Clearing command window and workspace
clc
clear
%Asking for inputs
R = input("Input the Resistance in Ohms:n");
Imax = input("Input the upper limit of current (greater than 0, in amps) to plotn");
%Creating 200 numeric values of current to plot
I = linspace(0,Imax,200);
%Solving for voltage (V)
V = R*I;
%Plotting voltage vs current
plot(I,V,"k-") input, command window, matlab online MATLAB Answers — New Questions