Info

この質問は閉じられています。 編集または回答するには再度開いてください。

concatenat values in rows in if else statement

1 回表示 (過去 30 日間)
om prakash
om prakash 2019 年 10 月 3 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
m = 2;
PU = 4;
NumBits=1000;
lamda_val=0.5;
si=rand(m,NumBits);
hi=rand(m,NumBits);
ni=rand(m,NumBits);
PU = input('Enter No. of primary user = ');
Fc = zeros(1, PU);
if PU >=1
for x = 1:PU
Fc(x) = input('Enter 1 for signal present and 0 for noise in channel = ');
end
else
disp('No primary signal detected');
return;
end
table = zeros(m,PU*NumBits);
for index = 1:(PU)
if Fc(index) == 1
for ii=1:m
temp(ii,:)=abs((hi(ii,:).*si(ii,:))+ni(ii,:)).^2;
end
else
for ii=1:m
temp_noise(ii,:)=abs(ni(ii,:)).^2;
end
end
table = [temp(ii,:) temp_noise(ii,:)]
end
can somebody tell me how to do this. I have to store values in rows.
I have edited the code for better understanding. Hope it helps.
If PU is 4 with values 1011, then values generated due to these values should be stored in concatenation to evaluate further.
Regards
Om Prakash

回答 (0 件)

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by