Why is the MATLAB workspace variable missing from my Visual Query Builder generated MATLAB file when using Database Toolbox?

1 view (last 30 days)
I am using the Database Toolbox Visual Query Builder to extract data from my database, as described in the "Getting Started with the Visual Query Builder GUI :: Visual Query Builder (Database Toolbox)" section of the documentation. After I retrieve the data, I select Query->Generate MATLAB file from the Visual Query Builder menu bar. I notice that my MATLAB workspace variable is missing in the generated code.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 5 Aug 2010
The ability to include a MATLAB workspace variable in MATLAB code generated by the Visual Query Builder is not available for the Database Toolbox.
To work around this issue, you can retrieve the data generated by your query by using the Data property of the cursor object. In the generated MATLAB file the cursor object is usually denoted by the variable e. You can copy the data to a new workspace variable by manually including the following line of code to the end of your generated MATLAB code:
myVar = e.Data;

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!