Your T is a column vector.
That makes dt a column vector, because indexing a column vector with a vector index returns a column vector no matter whether the index itself is row or column.
Nt is scalar, 1./Nt is scalar. dt is column vector, scalar ./ column vector gives column vector.
f=[-fliplr(1:(Nt/2)) 0 (1:(Nt/2-1))].*df;
1:(Nt/2) is a row vector. fliplr() of a row vector is a row vector. 1:(Nt/2-1) is a row vector. [row vector, 0, row vector] gives a row vector.
Then you .* the row vector with a column vector. Implicit expansion is used, and you get a result which is length() of the column vector, by length() of the row vector -- a 2D array.
You then try to pass in f as the YData parameter to imagesc(), but the YData parameter to imagesc() must be one of:
- A scalar
- A vector with two or more elements. In this case, the first and last entries are used and the rest are ignored
Your 2D array is not empty or a scalar or a vector with two elements, so you are given an error message.
You have the same problem with construction of k: it will be a 2D array as well, for the same reason: you are combining row vectors and column vectors with implicit expansion.
T = Dasdata.Time(channels) .';
X = Dasdata.Position(channels) .';