Save a variable from a for cycle into a matrix
5 views (last 30 days)
Hey guys, this is probably very easy but Im having troubles.
I have a matrix range_compression(2032x400). Each row corresponds to a position of a radar and columns correspond to signals in frequency domain.
For each column I apply a function that transforms that signal to time domain. However the code I have is saving all of this in a vector 1x 2243277. And I would like to save it in a matrix 2032x400. Thank you all
Image Analyst on 12 Jun 2022
output = zeros(rows, columns);
for col = 1 : columns
% Get a column
thisColumn = Range_compression(:, col);
% Convert it to time domain.
% Save the output (whichever vector it is)
output(:, col) = time_compression; % Or whatever...
If you have any more questions, then attach your data, the freq2time function, and code to read the data in with the paperclip icon after you read this: