I am trying to write a simple data analysis program in the App designer, but i have probme with plotting my dat. I do the following:
- Load my data and plot them in a set of Axis. Works fine
- locate the Peaks in the data, with Peakfinder, and lable them with text. Work fine
- Now I need the area under the curve, så i fit a "baseline" to the data. Works fine with a button
- Now I plot the baseline into the same set of Axis (Within in the same "button") and it works fine the first time, and I have the two plot in Axis. BUT if i press the botton once more I only have the baseline (last plot). And then for evry second time i pres the button I have two plots, the other times I have one line
The following minimal code reproduces the behavour:
Any idea of what is going on or where I can lear more? It is clear what the problem is?
I use Matlab R 2019a on a WIN10 64 bit HP computer