Link to home
Start Free TrialLog in
Avatar of Buginator
BuginatorFlag for Norway

asked on

Make a matrix from the string values from textboxes in GUI

I retrieve several values from different textboxes in my GUI, and each textbox contains a number. I'm trying to make a matrix of these string values. I've tried a few ways to do this, but all I get is this error:

??? Error using ==> vertcat
CAT arguments dimensions are not consistent.

Error in ==> gui_gettable at 78
Q =[QTBox1 QTBox2 QTBox3 QTBox4 QTBox5 QTBox6 QTBox7 QTBox8

How can I make a valid matrix from the string value in the textboxes?
QTBox1 = get(handles.txtQTBox1, 'String');
QTBox2 = get(handles.txtQTBox2, 'String');
QTBox3 = get(handles.txtQTBox3, 'String');
QTBox4 = get(handles.txtQTBox4, 'String');
QTBox5 = get(handles.txtQTBox5, 'String');
QTBox6 = get(handles.txtQTBox6, 'String');
QTBox7 = get(handles.txtQTBox7, 'String');
QTBox8 = get(handles.txtQTBox8, 'String');
 
QTBox9 = get(handles.txtQTBox9, 'String');
QTBox10 = get(handles.txtQTBox10, 'String');
QTBox11 = get(handles.txtQTBox11, 'String');
QTBox12 = get(handles.txtQTBox12, 'String');
QTBox13 = get(handles.txtQTBox13, 'String');
QTBox14 = get(handles.txtQTBox14, 'String');
QTBox15 = get(handles.txtQTBox15, 'String');
QTBox16 = get(handles.txtQTBox16, 'String');
 
Q = [QTBox1 QTBox2 QTBox3 QTBox4 QTBox5 QTBox6 QTBox7 QTBox8
    QTBox9 QTBox10 QTBox11 QTBox12 QTBox13 QTBox14 QTBox15 QTBox16];
 
Q = str2num(Q);

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of yuk99
yuk99
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Buginator

ASKER

Simple as that. Thanks.