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?
Best Answer