I'm having trouble plotting some time-series data in App Designer (using 2017b) on a UIAxes.
The original time-series data is very noisy, hence the loaded data (which the user selects by UIGetFile) gets detrended and notch filtered (the frequencies for the Notch are from a UITable, which the user enters) after checking the Welch PowerSpectra on a separate UIAxes.
I can easily get it to work outside of App Designer but it would be excellent to keep it all in the UIFigure and on the specified UIAxes (I can get the filtered timeseries data to display in a seperate plot, just not in the UIAxes [had the same trouble with the Spectrogram]).
Bx = app.Bx; % Grabs data from loaded file
t = 0:(size(Bx,1)-1); % Sets the time from size of data
t = t/Freq; % divides time by Frequency @ which the data is recorded
Bx1 = timeseries(Bx, t); % Set the timeseries
FreqNotch = app.UITable.Data; % Grab Frequencies to Notch from values entered in UITable
Bx1 = detrend(Bx,'constant'); % Get rid of the mean
ts1 = idealfilter(Bx1,FreqNotch,'Notch'); % Notch filter the data
plot(app.UIAxes, ts1); % Doesn't work, returns error
plot(ts1); % Does Work, just plots in a seperate figure
Error message is:
Error using plot. Data Must be numeric, datetime, duration or an array convertible to double.