I am calling a MatLab script from a python script and my MatLab script requires user input. When I am prompted for input the terminal doesn't allow input. Am I able to get user input into the MatLab function when I run the function from python? How would you do this?
Python:
import matlab.engine
import time
from datetime import datetime
import thread
import threading
eng = matlab.engine.start_matlab()
eng.easyRun(20181116,nargout=0)
eng.quit()
print "Python script complete"
MatLab:
function easyRun(dateInput)
disp('-------------------------')
disp('Plot Types:')
disp('1 - x,y,z')
disp('2 - Magnitude')
%This is where I am asking for user input
plotType = input('Enter plot type # (1-2): ');
disp(plotType)
disp(dateInput)
end
For example an input of 1
will result in an output of:
1
20181116
This is part of a bigger program where I am multi-threading a MatLab function so I can process a week of data all at the same time, but that part is not needed for this question