- (0:length(s)-1)'/Fs, where s is the signal and Fs is a scalar in the workspace representing a sample rate.
- linspace(2,2.5,length(s))', where s is the signal.
- minutes(0:15)', equivalent to taking measurements every minute for 15 minutes.
- [0:10 20:30], equivalent to taking two sets of measurements at 1 Hz with a long pause between the sets.
Signal Analyser - Time Values Query for Re-Sampling
2 views (last 30 days)
I am attempting to re-sample a signal (and array of signals if possible) in the Signal Analyser app. The catpured data is imported from ANSYS which has a variable step solver. I have the captured signals (i.e., volume_03) and the time signal (t) in the workspace, all are 574x1 doubles. When I go to change the x-axis to "Time Values" and select the time signal in the worspace I encounter an error. Can a time signal be selected in this manner?
Thanks in advance
Cris LaPierre on 26 Aug 2022
It appears the time values you are using contain duplicate values (or maybe NaNs?), which is not allowed. However, yes, you can specify a variable as your time values.
See this page, which says:
Use this option when you know the time value corresponding to each sample. Specify the time values using a MATLAB expression or the name of a variable in the MATLAB workspace.
The Time Values can be stored in a numeric vector with real time values expressed in seconds. The values must be unique and cannot be NaN, but they need not be uniformly spaced. The vector must have the same length as the signal.
The time values can also be stored in a duration array. The values must be unique and cannot be NaN, but they need not be uniformly spaced. The array must have the same length as the signal.
The time values can also be entered as a MATLAB expression. The expression must specify an array with the same length as the signal. The values must be unique and cannot be NaN, but they need not be uniformly spaced. Valid examples include:
In all cases, the app derives a sample rate from the time values and displays it in the Time column of the Signal table. An asterisk preceding the sample rate indicates that the signal is nonuniformly sampled.