I want to find the P1 matrix but encountered some problems.
These are my code:
clear all
close all
clc
K=128;
for u=0:1:K-1
for u=0:1:K-1
p=exp(-1i*2*pi*u*v/K)*eye(5);
P1(u+5,v+5)=p;
end
end
thanks a lot!!

 채택된 답변

Voss
Voss 2022년 12월 6일
편집: Voss 2022년 12월 6일

1 개 추천

M = 128;
K = 5;
P1 = zeros(M*K);
for u = 0:K-1
for v = 0:K-1
p = 1/sqrt(K) * exp(-1i*2*pi*u*v/K) * eye(M);
P1(M*u+(1:M),M*v+(1:M)) = p;
end
end
P1 = P1'; % don't forget the H

댓글 수: 2

david chuang
david chuang 2022년 12월 6일
You’re an amazing problem solver,have a nice day!
Thank you very much
Voss
Voss 2022년 12월 6일
You're welcome!

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품

릴리스

R2020a

질문:

2022년 12월 6일

댓글:

2022년 12월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by