3

I'm analyzing several different data sets that individually take a while to process. I need to input a bunch of information for each set of data, but the info itself (series of strings) is arbitrary and unimportant to the analysis. To save time overall, I want to present all the input fields initially, but not have the code wait for me to finish filling all the info in before proceeding with the analysis. Hopefully the example code below clarifies my objectives.

%%%% Best code ever

% Select data file
filename = uigetfile

% Ask for information related to data set
info1 = input('Info1? = ','s');
info2 = input('Info2? = ','s');

% Load data and begin analysis without waiting for user response to inputs above
pause(1); % arbitrary time intensive process

% More code to display/save after inputs are entered data analysis finishes
plot(x,y)

%%%%

I had issues with searching for similar topics because the only keyword/phrase I could come up with was "parallel processes" but that seemed to open a much more complex can of worms. The only luck I had was here, but it seemed too specific and I got lost since my coding abilities are casual at best...

1 Answer 1

2

MATLAB's interpreter is single-threaded, which means you can only do one thing at a time. I think your best option would be to create a GUI (perhaps with GUIDE) for inputting the information, which the user could interact with while the other code was running. I'm afraid this is essentially the same solution as proposed in the question you linked to, I don't think there's a much easier way to do this.

Sign up to request clarification or add additional context in comments.

1 Comment

Yikes that seems overkill for my purposes. Shame there isn't a simple way to do this sort of thing. Thanks for clearing that up for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.