Can the MATLAB Engine API implement interactive operations in the MATLAB Command Window?
In the MATLAB interface window, when running some programs or scripts, some interactive instructions are required, such as giving a prompt in the command window and asking the user to enter some numbers ,Y or N, and pressing the enter key, then the program will continue to execute based on the input content. Can the above operation be achieved using Python through the Matlab Engine API interface without opening the Matlab interface now?The following is a function that requires interactive operations in the command window of Matlab:
function my_function()
disp(‘Step 1: Please enter a number:’);
x = input(”);
disp([‘You entered: ‘, num2str(x)]);
disp(‘Step 2: Please enter another number:’);
y = input(”);
disp([‘You entered: ‘, num2str(y)]);
end
How to use Python to call the above function through the Matlab Engine API and achieve its normal operation? The prompt words and input content are completed through programming or input in Python.In the MATLAB interface window, when running some programs or scripts, some interactive instructions are required, such as giving a prompt in the command window and asking the user to enter some numbers ,Y or N, and pressing the enter key, then the program will continue to execute based on the input content. Can the above operation be achieved using Python through the Matlab Engine API interface without opening the Matlab interface now?The following is a function that requires interactive operations in the command window of Matlab:
function my_function()
disp(‘Step 1: Please enter a number:’);
x = input(”);
disp([‘You entered: ‘, num2str(x)]);
disp(‘Step 2: Please enter another number:’);
y = input(”);
disp([‘You entered: ‘, num2str(y)]);
end
How to use Python to call the above function through the Matlab Engine API and achieve its normal operation? The prompt words and input content are completed through programming or input in Python. In the MATLAB interface window, when running some programs or scripts, some interactive instructions are required, such as giving a prompt in the command window and asking the user to enter some numbers ,Y or N, and pressing the enter key, then the program will continue to execute based on the input content. Can the above operation be achieved using Python through the Matlab Engine API interface without opening the Matlab interface now?The following is a function that requires interactive operations in the command window of Matlab:
function my_function()
disp(‘Step 1: Please enter a number:’);
x = input(”);
disp([‘You entered: ‘, num2str(x)]);
disp(‘Step 2: Please enter another number:’);
y = input(”);
disp([‘You entered: ‘, num2str(y)]);
end
How to use Python to call the above function through the Matlab Engine API and achieve its normal operation? The prompt words and input content are completed through programming or input in Python. matlab engine api for python, interactive operations, command window MATLAB Answers — New Questions