一个matlab语句,K = 128; % SIZE OF FFT N = 8; % NUMBER OF SELECTIONSQPSK_Set = [1 -1 j -j];Phase_Set = [1 -1];MAX_SYMBOLS = 1e4;PAPR_Orignal = zeros(1,MAX_SYMBOLS);%一行,10000列PAPR_SLM = zeros(3,MAX_SYMBOLS);%三行,10000列X = zeros(N,K);Inde
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/30 00:47:33
一个matlab语句,K = 128; % SIZE OF FFT N = 8; % NUMBER OF SELECTIONSQPSK_Set = [1 -1 j -j];Phase_Set = [1 -1];MAX_SYMBOLS = 1e4;PAPR_Orignal = zeros(1,MAX_SYMBOLS);%一行,10000列PAPR_SLM = zeros(3,MAX_SYMBOLS);%三行,10000列X = zeros(N,K);Inde
一个matlab语句,
K = 128; % SIZE OF FFT
N = 8; % NUMBER OF SELECTIONS
QPSK_Set = [1 -1 j -j];
Phase_Set = [1 -1];
MAX_SYMBOLS = 1e4;
PAPR_Orignal = zeros(1,MAX_SYMBOLS);%一行,10000列
PAPR_SLM = zeros(3,MAX_SYMBOLS);%三行,10000列
X = zeros(N,K);
Index = zeros(N,K);
for nSymbol=1:MAX_SYMBOLS
Index(1,:) = randint(1,K,length(QPSK_Set))+1;%一行,128列.数的取值为1~4 Index矩阵的第一行
Index(2:N,:) = randint(N-1,K,length(Phase_Set))+1;%Index矩阵的第二行到第N行
① X(1,:) = QPSK_Set(Index(1,:)); % Orignal Frequency domain signal 原始频域信号
Phase_Rot = Phase_Set(Index(2:N,:));
X(2:N,:) = repmat(X(1,:),N-1,1).*Phase_Rot;
补充一个问题吧,如果两个问题都回答的话再加10分:
max的用法,主要是这个C=max(A,[ ],dim),dim代表维数,
我试了一下,令A=magic(5),则:max(A,[],1)
ans =
23 24 25 21 22
max(A,[],2)
ans =
24
23
22
21
25
一个matlab语句,K = 128; % SIZE OF FFT N = 8; % NUMBER OF SELECTIONSQPSK_Set = [1 -1 j -j];Phase_Set = [1 -1];MAX_SYMBOLS = 1e4;PAPR_Orignal = zeros(1,MAX_SYMBOLS);%一行,10000列PAPR_SLM = zeros(3,MAX_SYMBOLS);%三行,10000列X = zeros(N,K);Inde
1 X(1,:) = QPSK_Set(Index(1,:)); %%X(1,:)表示X的第一行,QPSK_Set应该是函数,Index(1,:)表示Index的第一行,经过处理,然后赋给X的第一行.
对应的X(:,1)表示X的第一列.X(:,2)第二列,以此类推.
2 >> a=magic(5)
a =
17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9
>> max(a,[],1)%%max是按列求最大值,该写法相当于求每列的最大值
ans =
23 24 25 21 22
>> max(a,[],2)%%求取每行的最大值
ans =
24
23
22
21
25