Tables in GUIs

2 views (last 30 days)
John
John on 11 Jun 2012
I have a 6x3 table in a GUI and when the user inputs numbers I would like to create a plot.
Beforehand however, I have another set of vectors (30x4) that stores the x-values and y-values that were inputted in the 6x3 table.
I have named the values that are inputted in the table as 'handles.data'. It is currently a 6x3 cell array.
Here is a snip of the code that I get the error message from: handles.xpoints_ip_accept(30,1) = handles.data{1,1}; handles.xpoints_ip_accept(30,2) = handles.data{1,2};
The error that appears is the following:
??? Subscripted assignment dimension mismatch.
Error in ==> acoustic_spec_comparison_tool>plot_but_Callback at 235 handles.xpoints_ip_accept(30,1) = handles.data{1,1}; handles.xpoints_ip_accept(30,2) = handles.data{1,2}
The weird thing is when I try 'handles.data{1,1}' alone I do get a value. Please help
  2 Comments
Walter Roberson
Walter Roberson on 11 Jun 2012
Please check
size(handles.data{1,1})
size(handles.data{1,2})
class(handles.data{1,1})
My first guess would be that the data is stored as strings rather than as numbers.
John
John on 11 Jun 2012
That was exactly the case. Thank you very much!

Sign in to comment.

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!