在Matlab中获取reshap命令中的错误

问题描述 投票:0回答:1

我正在编写脚本,我需要使用reshape命令。

这是我的代码:

Bit_Num=4; 
FFT_Num=64; 
Carrier_Num=48;
OFDM_per_Symbol=1; 
CP=16;  
LI=12 ; 
Np=4; % Number of pilot
Carriers=1:Carrier_Num+Np;
N_Num=Bit_Num*Carrier_Num*OFDM_per_Symbol;
BitTx=randi(1,N_Num);
N_Num=length(BitTx);
SymQAMtmp=reshape(BitTx,4,N_Num/4).';

我正在使用Matlab 2015进行编码,这没关系。但是,我需要在Matlab 2017中运行我的代码。

我收到了这个错误:

Error using reshape
To RESHAPE the number of elements must not change.

任何人都可以帮我解决这个问题吗?

matlab
1个回答
0
投票

您应该阅读'randi'的工作原理。输入'help randi'以查看randi(1,N_Num)生成包含所有元素“1”的N_Num x N_Num矩阵。

© www.soinside.com 2019 - 2024. All rights reserved.