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.
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:
- (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.
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.