필터 지우기
필터 지우기

Incorrect values of two-dimensional matrix after division operation

조회 수: 1 (최근 30일)
bassant tolba
bassant tolba 2022년 11월 17일
댓글: bassant tolba 2022년 11월 17일
Hello everyone,
Please I'm trying to implement this equation in matlab to get ro_optimum which is two dimensions (10 x 10)
I wrote this code to get the value of ro_optimum, but I got atwo dimentional matrix which has the same values of elements in each row which is a strange result.
This is the equation I'm trying to write;
CK=[500,600,700,800,900,1000,1100,1200,1300,1400]';
a = 500;
b = 2000;
TN=10;
Lks = ((b-a).*rand(10) + a);
aa = 0.1;
bb = 1;
Fkm = ((bb-aa).*rand(10,1) + aa)*(10^9);
Fkf= ((bb-aa).*rand(10,1) + aa)*(10^9);
Rk=((bb-aa).*rand(10,1) + aa)*(10^9);
for k=1:1:TN
for s=1:1:TN
DRK_hat_(k)=Lks(k,s)./Rk(k)
DRK_hat=(DRK_hat_)'
tks_hat(k,s)=(CK(k).*Lks(k,s))./Fkf(k)
tks_only(k,s)=(CK(k).*Lks(k,s))./Fkm(k)
ro_opt(k,s)=(tks_only(k,s))./(DRK_hat(k)+tks_hat(k,s)+tks_only(k,s))
end
end
I'm expecting to get a two dimension matrix (10 x10) with whole different values in each row and each column..
Please,can anyone help me ?
  댓글 수: 2
David Hill
David Hill 2022년 11월 17일
We have no idea what several of your variables are like (TN, gamma_k, B, DRK_hat).
bassant tolba
bassant tolba 2022년 11월 17일
Dear David,
I have updated the question and added the required values

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

채택된 답변

Torsten
Torsten 2022년 11월 17일
L(k,s) cancels out in your formula for ro_opt(k,s). Thus ro_opt(k,s) only depends on k, not on s.

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by