我正在研究一个项目,我想在一个频段内绘图/显示,由起始频率和终止频率定义的脉冲。
说明:我有X个组,每个组包含Y个网络。 我的乐队有一个起点和一个终点。每个网络都有一个频段。
我有2个小组。第一组包含4个网络,第二组包含9个网络。我的频段开始于30 MHz,结束于88 MHz。 对于第一组,每个网络具有W MHz频段,对于第二组,每个网络具有Z MHz频段。我想要一个表示当有频段时有脉冲的情况。
我必须将每个网络相隔30KHz,并按7%((frequencyStopPreviousGroup * 0.07)+ frequencyStopPreviousGroup)将组分开。
有间隔的时候,我不要脉冲。
每个网络都在一个单元格“组”中,而组单元格在一个全局单元格中。
我的问题是:我不知道从哪里开始,我可以使用什么功能来按部分问题创建表示形式?
我知道我下面的代码没有经过优化,但是可以按我的意愿工作。
D_format = 11389527,26654; % 11,389 MHz by example
% We divide D by the number of networks of each group to know what band have a network.
% Global cell which contains each cellOfRange
global_cellOfRange = cell(1, max(group));
% For each group
for current_group = 1 : max(group)
% We divide D by the number of networks in the current group
networkXRange = D_format / size_of_group(current_group);
networkXRange_format = networkXRange
% Cell with the start and stop of each network
cellOfRange = cell(4, size_of_group(current_group));
% If it is the first group
if current_group == 1
% For each network
% size_of_group(current_group) = the number of network in the current group
for numberOfNetwork = 1 : size_of_group(current_group)
% If it is the first network
if numberOfNetwork == 1
frequencyStartNetwork = 30000000; % 30 MHz
frequencyStopNetwork = frequencyStart_1 + networkXRange_format;
end
% If it is an other network
if numberOfNetwork > 1
% Margin
frequencyStart_1xMargin = 30000; % 30 KHz
% We add the margin for the next network
frequencyStartNetwork = frequencyStopNetwork + frequencyStart_1xMargin;
frequencyStopNetwork = frequencyStartNetwork + networkXRange_format;
end
% We print in a matrix the range for each network in the current group
cellOfRange{1,numberOfNetwork} = ['Network' int2str(numberOfNetwork)];
cellOfRange{2,numberOfNetwork} = ' ';
cellOfRange{3,numberOfNetwork} = 'Frequency Start (Hz)';
cellOfRange{4,numberOfNetwork} = double(frequencyStartNetwork);
cellOfRange{5,numberOfNetwork} = ' ';
cellOfRange{6,numberOfNetwork} = 'Frequency Stop (Hz)';
cellOfRange{7,numberOfNetwork} = double(frequencyStopNetwork);
% Start frequency of the first network of the next group
frequencyStartNextGroup = frequencyStopNetwork + (frequencyStopNetwork * 0.07); % 0.07 = 7 %
end
% If we aren't at the first group
else
% For each network
% size_of_group(current_group) = the number of network in the current group
for numberOfNetwork = 1 : size_of_group(current_group)
% If it is the first network
if numberOfNetwork == 1
frequencyStartNetwork = frequencyStartNextGroup;
frequencyStopNetwork = frequencyStartNetwork + networkXRange_format;
end
% If it is not the first network of the group
if numberOfNetwork > 1
frequencyStart_1xMargin = 30000; % 30 KHz
% We add the margin for the next network
frequencyStartNetwork = frequencyStopNetwork + frequencyStart_1xMargin;
frequencyStopNetwork = frequencyStartNetwork + networkXRange_format;
end
% We print in a matrix the range for each network in the current group
cellOfRange{1,numberOfNetwork} = ['Network' int2str(numberOfNetwork)];
cellOfRange{2,numberOfNetwork} = ' ';
cellOfRange{3,numberOfNetwork} = 'Frequency Start (Hz)';
cellOfRange{4,numberOfNetwork} = double(frequencyStartNetwork);
cellOfRange{5,numberOfNetwork} = ' ';
cellOfRange{6,numberOfNetwork} = 'Frequency Stop (Hz)';
cellOfRange{7,numberOfNetwork} = double(frequencyStopNetwork);
end
end
% current_group % DEBUG
% We store cells in a global cell
global_cellOfRange{1,current_group} = cellOfRange;
% If it is not the last group
if current_group < max(group)
% Start frequency of the first network of the next group
frequencyStartNextGroup = frequencyStopNetwork + (frequencyStopNetwork * 0.07);
end
%disp(['global_cellOfRange = ' global_cellOfRange]);%DEBUG
end
我认为这是一个很好的基础,但是我对这部分迷失了。
感谢您为我的问题付出的宝贵时间!
卡恩