How can I fill in a matrix with the data of a multiline edittext box?

1 次查看(过去 30 天)
Hello, I have a gui with a multiline edittext box and I want for example to write on three lines 9 numbers (3 numbers on each line) and to create a 3x3 matrix. How can I do that? I know that an edittext box get strings but how can my program count the written lines of my edittext, and then create a matrix with the transformed strings to numbers?
kind regards!

采纳的回答

Walter Roberson
Walter Roberson 2013-11-19
get(EditBoxHandle, 'String') is going to return a cell array of strings. length() of the cell array will tell you how many lines there are.
You will need to convert the strings to numbers. See sscanf()

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Text Data Preparation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by