Can the MATLAB Report Generator 3.8 (R2010a) be used to generate a report which calls a user interactive GUI?

1 view (last 30 days)

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 19 Aug 2010
To be able to make the Report Generator wait for user input when the GUI is called, you need to make use of UIWAIT/UIRESUME.
The GUI needs to be set up such that UIWAIT is called after the GUI has been created and requires user input (typically in the opening function).
After the user interacts with the GUI and needs the GUI to resume execution, you need to call UIRESUME in the callback of the UICONTROL.
The attached example demonstrates this approach. In this case, the GUI has been created using GUIDE.
To execute this example,
1. Extract the files
2. Double click on 'report_with_guide.rpt' in MATLAB
3. Click on File --> Report (In Report Explorer)
4. This will launch the GUI, enter some input and click OK
5. A report will be generated as a PDF-file in the same directory.
Steps followed to create this example:
1. Created the GUI in GUIDE.
2. In the opening function, added call to UIWAIT
3. In the callback function for the pushbutton, included UIRESUME, corresponding to UIWAIT in step 2
4. Added call to DISP in the callback to print output to the report.
To generate the RPT-file:
1. Started report generator, by executing REPORT at MATLAB command prompt (this opens Report Explorer)
>> report
2. Clicked on File--> New; saved it in the current folder
3. Clicked on MATLAB --> Evaluate MATLAB Expression and added the component
4. In the ‘Expression to evaluate in the base workspace’, added the call to GUI

More Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Tags

No tags entered yet.

Products


Release

R2010a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!