could anyone help me to overcome the error stating RESHAPE the number of elements must not change.

조회 수: 1 (최근 30일)
function [ rx_data ] = ofdm_rx( sym_seq, mod_ofdm )
N_data = mod_ofdm.FFTLength - sum(mod_ofdm.NumGuardBandCarriers) - 1 - length(mod_ofdm.PilotCarrierIndices);
N_P = length(mod_ofdm.PilotCarrierIndices);
num_ofdmsym = mod_ofdm.NumSymbols;
pilot_seq_complex = rand (N_P, num_ofdmsym), rand (N_P, num_ofdmsym);
sym_mat = reshape(sym_seq, N_data, num_ofdmsym);
rx_data = step(mod_ofdm,sym_mat,pilot_seq_complex);
end
When i run the code containinf function i am getting error stating
Error using reshape
To RESHAPE the number of elements must not change.
Error in line 10 sym_mat = reshape(sym_seq, N_data, num_ofdmsym);
  댓글 수: 4
Image Analyst
Image Analyst 2019년 1월 8일
Luna, please put answers down BELOW in the official Answers section, so you can get credit for it. Your first comment looks pretty much like an answer to me.
Luna
Luna 2019년 1월 9일
편집: Luna 2019년 1월 9일
Thanks, I moved the comment down as an answer :)

댓글을 달려면 로그인하십시오.

답변 (1개)

Luna
Luna 2019년 1월 9일
Actually the error gives you the hint. The number of elements inside the array should be equal to multiplication of dimensions.
For example:
A is MxN matrix, and you want to reshape it into PxR matrix. Then M*N should be equal to P*R. So that reshape function can work as follows:
newA = reshape(A,P,R);
What is sym_seq, mod_ofdm ? And what do you want as desired output?

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by