高手帮我详细解释一下这个MATLABA程序好吗
function吧
全部回复
仅看楼主
level 1
宋欢欢011 楼主
function sim_options = ui_read_options% frame length, in symbols分组长度,用比特表示
Frm_length = eval(get(findobj('Tag', 'FrmLen'),'String'));% number of packets
NumberofPackets = eval(get(findobj('Tag', 'NumofPkt'),'String'));% Modulation交织方式
modulation = get(findobj('Tag', 'Modulation'),'String');
modulation = modulation(get(findobj('Tag', 'Modulation'),'Value'),:);% Channel models信道模型
if get(findobj('Tag', 'AWGN '),'Value')
chan_model = 'AWGN ';
elseif get(findobj('Tag', 'Rayleigh'),'Value')
chan_model = 'Rayleigh';
end% Rx Diversity options接收分集
oneRx = get(findobj('Tag', '1Rx'),'Value');
if oneRx==1
rx_div=1;
end
twoRx = get(findobj('Tag', '2Rx'),'Value');
if twoRx==1
rx_div=2;
end
threeRx = get(findobj('Tag', '3Rx'),'Value');
if threeRx==1
rx_div=3;
end
fourRx = get(findobj('Tag', '4Rx'),'Value');
if fourRx==1
rx_div=4;
end
% Tx Diversity options发射分集
oneTx = get(findobj('Tag', '1Tx'),'Value');
if oneTx==1
tx_div=1;
end
twoTx = get(findobj('Tag', '2Tx'),'Value');
if twoTx==1
tx_div=2;
end
threeTx = get(findobj('Tag', '3Tx'),'Value');
if threeTx==1
tx_div=3;
end
fourTx = get(findobj('Tag', '4Tx'),'Value');
if fourTx==1
tx_div=4;
end
if isempty(rx_div)
rx_div=2;
end
if isempty(tx_div)
tx_div=2;
end
if rx_div==1 & tx_div==1
uiwait(errordlg('STBC not applicable for SISO systems!! Program will exit to Command line.','Invalid Input','Modal'));
return;
end
if (rx_div==3 & tx_div==1) || (rx_div==3 & tx_div==2) || (rx_div==4 & tx_div==2) || (rx_div==2 & tx_div==3) || ...
(rx_div==3 & tx_div==3) || (rx_div==2 & tx_div==4) || (rx_div==3 & tx_div==4)
uiwait(errordlg('STBC not coded for 1x3, 2x3, 2x4, 3x2, 3x3, 4x2 and 4x3 systems!!Program will exit to Command line.','Invalid Input','Modal'));
return;
end
% channel estimation
ch_est=get(findobj('Tag', 'Channel_Est'),'Value');
if ch_est==1 & (rx_div~=2 || tx_div~=2)
uiwait(errordlg('Channel Estimation: Code programmed for 2x2 system only!! Program will exit to Command line','Invalid Input','Modal'));
return;
end%receive correlation
rx_corr=get(findobj('Tag', 'Rx_corr'),'Value');%Save file
savefile=get(findobj('Tag', 'Savefile'),'Value');
filename = get(findobj('Tag', 'FileName'),'String');str1=filename;
if isempty(str1) & savefile==1
uiwait(errordlg('Enter file name!! Program will exit to Command line','Invalid Input','Modal'));
return;
end%correlation coefficient
Rx_corr=get(findobj('Tag', 'Rx_corr'),'Value');
corr_val_str=eval(get(findobj('Tag', 'corr_value'),'String'));if corr_val_str==0 & Rx_corr==1 || corr_val_str < 0 || corr_val_str > 1
uiwait(errordlg('Enter correlation coefficient value between 0 and 1!! Press CNTL+C to exit to Command line.','Invalid Input','Modal'));
return;
endRx_corr=get(findobj('Tag', 'Rx_corr'),'Value');
if Rx_corr==1 & (rx_div~=2 || tx_div~=2)
uiwait(errordlg('Receive Correlation: Code programmed for 2x2 system only!! Press CNTL+C to exit to Command line.','Invalid Input','Modal'));
return;
endsim_options = struct('FrmLen', Frm_length, ...
'NumberofPackets', NumberofPackets, ...
'Modulation',modulation, ...
'ChannelModel',chan_model, ...
'TxDiv',tx_div, ...
'RxDiv',rx_div, ...
'Channel_Est',ch_est, ...
'Rx_corr', rx_corr, ...
'corr_value',corr_val_str, ...
'Savefile',savefile,...
'FileName',filename);
2013年05月21日 02点05分 1
level 1
[感动][感动]我也没看懂,求加个楼主QQ和楼主一起探讨[抱枕]
2014年10月29日 07点10分 3
level 12
先要获得昵称币才能兑换改名卡,方法就是:连续十个不同表情(可复制我的),或者图片,或者一直点赞!
[呵呵] [哈哈] [吐舌] [啊] [酷] [怒] [开心] [汗] [泪] [黑线] ……
2017年07月07日 06点07分 4
1