error using horzcat while working gui.

1 回表示 (過去 30 日間)
sermet
sermet 2014 年 4 月 29 日
編集済み: Roberto 2014 年 4 月 29 日
raw={'p1'; 'p2'; 'p3'} %points id
column1=[200;250;300] %distances
column1=num2cell(column1)
checked=false(size(raw,1),1) %is it checked?
cellArray=[raw,column1,checked]
set(handles.uitable5, 'Data', cellArray) %uitable5 in my gui with blank
set(handles.uitable5, 'ColumnFormat', {'string', 'numeric', 'logical'})
set(handles.uitable5, 'CellEditCallback', @check_checked)
%when run these codes horzcat error occur. How can I eliminate this error.

採用された回答

Roberto
Roberto 2014 年 4 月 29 日
編集済み: Roberto 2014 年 4 月 29 日
The problem is that you are trying to concatenate matrices and cells,
try this:
raw={'p1'; 'p2'; 'p3'} %points id
column1=[200;250;300] %distances
column1=num2cell(column1)
checked=false(size(raw,1),1) %is it checked?
cellArray=[raw,column1,num2cell(checked)]
set(handles.uitable5, 'Data', cellArray) %uitable5 in my gui with blank
set(handles.uitable5, 'ColumnFormat', {'string', 'numeric', 'logical'})
set(handles.uitable5, 'CellEditCallback', @check_checked)
or this... depending on what you want:
raw={'p1'; 'p2'; 'p3'} %points id
column1=[200;250;300] %distances
column1=num2cell(column1)
checked=false(size(raw,1),1) %is it checked?
cellArray= {raw,column1,checked}
set(handles.uitable5, 'Data', cellArray) %uitable5 in my gui with blank
set(handles.uitable5, 'ColumnFormat', {'string', 'numeric', 'logical'})
set(handles.uitable5, 'CellEditCallback', @check_checked)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDialog Boxes についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by