I recently migrated my gui from guide to app design. Everything was working prior to the move. one last (hopefully) issue i am facing is updating the text on a label to a numberical value returned by numel() function.
error is :
Error using matlab.ui.control.internal.model.mixin.MultilineTextComponent/set.Text (line 49)
'Text' must be a character vector, or a 1-D array of the following type: cell array of character vectors, string, or categorical.
The code :
while strcmp(value,'On')
[plyX, plyY] = ginput(2);
width = abs(plyX(1) - plyX(2));
height = abs(plyY(1) - plyY(2));
rec = rectangle('Position',[plyX(1) plyY(1) width height]);
[in,on] = inpolygon(app.X,app.Y,plyX,plyY);
inon = in | on;
idx = inon(:);
xcoord = app.X(idx);
PointsInSelection = numel(xcoord);
app.Label.Text = PointsInSelection;
pause(3);
delete(rec);
end