MATLAB Answers

I need help with this MATLAB question

7 views (last 30 days)
Mia on 8 Oct 2019
Commented: Ankit on 8 Oct 2019
For this, you will write Matlab program that will do the following:
  • Use a pop-up dialog to query the user for the name of a text file.
  • Read a matrix of numbers from the file into your program. This data will be arranged so that each column corresponds to a "subject", and each row to some experimental "data" about that subject taken over multiple days.
  • Print out the raw data to the console.
  • Make a plot containing two subplots(one above the other in a single figure window):
-Subplot 1: plot the raw data for each user against time in a single plot.
- Subplot 2: plot the mean and standard deviation over all users against time
- Label the axes on all plots(including the plots below)
  • Using for loops, remove all negative data(specifically, set any negative data to zero)
  • Print out the altered data to the console
  • Make a second plot with the same description as the first using the modified data.
  • Confirm with the user using a pop-up dialog before closing all figures.
You must follow the requirements below to make automated grading possible:
  • Use the provided Matlab functions get_infilename() and load_if_possible(), and call confirm_dialog() before closing your figures.
  • Use disp() to show raw data (where it says "print out the data to the console").
  • First plot must be figure(1)
  • Second plot must be figure(2).
  • Use Matlab's default fonts, colors,linestyles, and all other plot properties.
  • Do not use call any other Matlab functions that create dialogs or in any other way prompt the user for input(for example: dialog, pause,listdlg).


Show 2 older comments
Mia on 8 Oct 2019
Thank you!!
Also, I know how to get user input but how do i get it through a pop up box?
Ankit on 8 Oct 2019
hows your confirm_dialog() function looks like?

Sign in to comment.

Answers (1)

Matt J
Matt J on 8 Oct 2019
I know how to get user input but how do i get it through a pop up box?
One option is inputdlg,


Sign in to comment.

Translated by