App Designer | error when trying to make one logical cell equal another

2 次查看(过去 30 天)
Hello,
Please assist with the below. Both are logical cells in a two different tables. I try to make one change as the other does in the UITablePlotHeadCellEdit function. I've read through multiple posts trying to solve this but don't understand what I'm doing wrong:
app.UITablePlotHead.Data{:,7}) == app.UITablePlotHead.Data(1,7)
For which my current error is:
Undefined function 'eq' for input arguments of type 'cell'.
Error in GraphingTemplate_Table12/UITablePlotHeadCellEdit (line 861)
if (app.UITablePlotHead.Data{1,7}) == true
Error using matlab.ui.internal.controller.uitable.WebMWTableController/fireCallbacksFromCellEdit (line 744)
Error while evaluating Table CellEditCallback.
Undefined function 'eq' for input arguments of type 'cell'.
Error in GraphingTemplate_Table12/UITablePlotHeadCellEdit (line 861)
if (app.UITablePlotHead.Data{1,7}) == true
Error using matlab.ui.internal.controller.uitable.WebMWTableController/fireCallbacksFromCellEdit (line 744)
Error while evaluating Table CellEditCallback.
I did try reading up on the warnings but couldn't successfully apply anything to my code.
I also tried:
if (app.UITablePlotHead.Data{1,7}) == true % {true} / 'true', I tried changing the brackets to parentheses, but nothing seems to work.
for i=1:length(fileList)
app.UITablePlots.Data(i,7) = {true};
end
Any guidance would be appreciated - thank you!

回答(1 个)

Mario Malic
Mario Malic 2021-1-17
Hey Connor,
When you assign data to UITable component, it'll remain the same variable type as original variable had. Therefore, in your case it'll be a numeric array, and you index into those using parantheses.
if app.UITablePlotHead.Data(3,7) % this will be true unless it equals to zero or it is empty
% code
end

类别

Help CenterFile Exchange 中查找有关 Develop Apps Using App Designer 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by