我无法在UIAxes上在App Designer中绘制一些时间序列数据(使用2017b)。
原始时间序列数据非常嘈杂,因此在检查Welch后,加载的数据(用户通过UIGetFile选择)得到去趋势和陷波过滤(Notch的频率来自用户输入的UITable) PowerSpectra在一个单独的UIAxes上。
我可以很容易地让它在App Designer之外工作,但是将它全部保存在UIFigure和指定的UIAxes中是非常好的(我可以将过滤后的时间序列数据显示在单独的图中,而不是在UIAxes [与频谱图有同样的问题])。
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
错误信息是:
使用绘图时出错。 数据必须是数字,日期时间,持续时间或可转换为double的数组。
答案 0 :(得分:0)
根据您提供的信息,我怀疑问题在于您访问数据的方式,在app.designer类中,存储为“属性”的数据通常组织在单元格中。
根据我修改语法的经验,您用于访问数据(弯括号,括号,点表示法等)将解决此问题。
没有更多信息,我将无法给出更精确的解决方案(即使这个答案是在问题六个月后做出的。)
答案 1 :(得分:0)
以下是我用来在应用设计器中的UIAxes上绘制经过陷波滤波的时间序列数据的解决方案的一部分,其中轴上的日期和时间正确。这是针对90个数据块(约550 Mb的ascii文件)中的5个独立通道的1000Hz数据(仅在下面显示一个)。
input_shape = (input_length,) # added 'input_length=' parameter
干杯,B K