How can I output variables from a GUI to the workspace in MATLAB 7.8 (R2009a)?
Show older comments
I have created a simple GUI in GUIDE with a uitable. Each row in the table represents a vector, with each column being 'x',y', or 'z' coordinate of a vector.
To specify the UITABLE, with my GUI open in GUIDE, I right click on the UITABLE and select View Callbacks->CreateFcn. I add the following to the uitable's Create Function:
% create 2x3 uitable and initialize each cell to 1
set(hObject, 'Data', num2cell(ones(2,3)))
% name the columns and rows in the uitable
set(hObject, 'RowName', {'1st vector', '2nd vector'}, 'ColumnName', {'x', 'y', 'z'});
% set the columns to be editable
set(hObject, 'ColumnEditable',logical([1,1,1]));
I want to compute a dot product between the two vectors in uitable when the cell in the uitable is edited, and store the result in the workspace. How can I do this?
Accepted Answer
More Answers (0)
Categories
Find more on Develop Apps Using App Designer in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!