# Unable to perform assignment because the size of the left side is 2032-by-1 and the size of the right side is 1-by-2243277.

2 views (last 30 days)
Miguel Albuquerque on 12 Jun 2022
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 getting this error
Unable to perform assignment because the size of the left side is 2032-by-1 and the size of the right side is 1-by-2243277.
I would like to save the outputs of the function in a matrix 2243277x400(columns of range_compression). How can I solve this error?
Thanks a lot
[rows,columns]=size(Range_compression);
output = zeros(rows, columns);
for col = 190 : 300
% Get a column
thisColumn = Range_compression(:, col);
% Convert it to time domain.
[time_compression,range_compressed]=freq2time(thisColumn, doppler_freqSurv);
% Save the output
time_compression=time_compression*c;
output(:, col)= time_compression;
output2(:, col)= range_compressed;
end
Miguel Albuquerque on 12 Jun 2022
Its not due to that dyuman.
It´s the same program, but are different questions Walter.
Thanks,

Walter Roberson on 12 Jun 2022
f=linspace(-max_f,max_f,2*max_f*(length(Fsig)-1)/(max(Fsig)-min(Fsig))+1);
linspace with two parameters always generates 100 points
t=linspace(-0.5/(f(2)-f(1)),0.5/(f(2)-f(1)),length(f)+1);
t=t(1:end-1);
One longer than f but throw away one, so t is the same length as f which is 100. t is the first output of freq2time so the first output will be 1 x 100.
[time_compression,range_compressed]=freq2time(thisColumn, doppler_freqSurv);
% Save the output
time_compression=time_compression*c;
output(:, col)= time_compression;
With time_compression being that vector length 100, then the assignment into output can only work if output has 100 rows.
[rows,columns]=size(Range_compression);
output = zeros(rows, columns);
not impossible but seems unlikely.
Miguel Albuquerque on 13 Jun 2022
Alright, thanks a lot

R2021b

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!