Azzera filtri
Azzera filtri

how delete xline in app designer

3 visualizzazioni (ultimi 30 giorni)
Luca Re
Luca Re il 5 Ott 2023
Commentato: Luca Re il 9 Ott 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

Risposte (1)

Jinal
Jinal il 9 Ott 2023
Modificato: Jinal il 9 Ott 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 Commento
Luca Re
Luca Re il 9 Ott 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

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!