Filter löschen
Filter löschen

how delete xline in app designer

3 Ansichten (letzte 30 Tage)
Luca Re
Luca Re am 5 Okt. 2023
Kommentiert: Luca Re am 9 Okt. 2023
function RilevaPeriodoButtonValueChanged(app, event)
value = app.RilevaPeriodoButton.Value;
if value
A=app.Eq.Live.idxBackTestInizio;
B=app.Eq.Live.idxBackTestFine;
TRIL=app.Eq.RP_bin(A:B);
% disp(find(TRIL))
xline(app.UIAxes_Eq_2,find(TRIL),'HandleVisibility','off')
else
%%DELETE IT! HOW??
end

Antworten (1)

Jinal
Jinal am 9 Okt. 2023
Bearbeitet: Jinal am 9 Okt. 2023
Hello Luca,
As per my understanding, you would like to know how to delete a ‘ConstantLine’ created using ‘xline’ function in App Designer.
The ‘delete’ function can be used to delete a graphic object such as a ‘ConstantLine’.
Refer to the following sample code for creating and deleting a constant vertical line by changing the state of a ‘StateButton’ in App Designer:
properties (Access = private)
x1 = [];
end
% Callbacks that handle component events
methods (Access = private)
% Value changed function: Button
function ButtonValueChanged(app, event)
value = app.Button.Value
if value
app.x1 = xline(app.UIAxes,0.2,'HandleVisibility','off');
else
if(isprop(app,'x1'))
delete(app.x1);
end
end
end
end
Please refer to the following documentation to know about deleting graphic objects using the ‘delete’ function:
I hope this resolves the issue you were facing.
  1 Kommentar
Luca Re
Luca Re am 9 Okt. 2023
hi, I already tried that solution but it doesn't work..
disp(isprop(app,'x1'))
if(isprop(app,'x1'))
delete(app.x1);
end
end
>> 0

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!