get the table from uitable into a matrix A
显示 更早的评论
tableData = get(handles.uitable1, 'Data')
tableData =
'99' [41]
'77' [13]
can i convert it to a normal matrix so i can do a function on it
5 个评论
Pawel Jastrzebski
2018-2-21
Guillaume
2018-2-21
table2array has nothing to do with uitable. It certainly won't know what to do with a cell array.
Pawel Jastrzebski
2018-2-21
编辑:Pawel Jastrzebski
2018-2-21
If I understood the code correctly:
tableData % returns a cell
Having recreated this cell, array2table seem to covert the cell to the table:
a = {'99' '77'} % cell
b = [41 13] % double
b = num2cell(b) % double to cell
tableData = [a' b'] % cell concatenation
t = array2table(tableData) % cell to table
The output:
t =
2×2 table
tableData1 tableData2
__________ __________
'99' [41]
'77' [13]
However, like you said, it doesn't make any sense to have the number stored as a char in the first place.
Walter Roberson
2018-2-21
Do you want the '99' to be converted to numeric so that you end up with a purely numeric array?
Amjad Green
2018-2-21
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Tables 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!