Solved

Make a matrix from the string values from textboxes in GUI

Posted on 2009-05-05
2
1,007 Views
Last Modified: 2013-11-25
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

0
Comment
Question by:Buginator
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 15

Accepted Solution

by:
yuk99 earned 500 total points
ID: 24304421
You have to do str2num before concatenation for each element separately.
0
 
LVL 5

Author Closing Comment

by:Buginator
ID: 31577972
Simple as that. Thanks.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question