?? get_datablock.m
字號:
function [data_block]=get_datablock(data,block_size,iteration)% [data_block]=get_datablock(data,block_size,iteration)%% Output:% data_block - Function output (binary-vector)% % Input:% data - Data to be put in parts, (one row many columns!!) (binary-vector)% block_size - Size of datablock in each transmission (integer splitting data into correct size)% iteration - Iteration cycle from 0 to number_of_blocks (integer 0,...)%% Short Theoretical Background for the Function:% % The function is meant to be called from an iteration-cycle,% where iteration tells the function which block to be called.%% If the block_size is not a integer-multiple of data, zeros are added.% If iteration > number_of_blocks, data_block is set to 0.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% Function part of simulation for Space-Time%%% coding project, group Grey-2001.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Author: Stefan Uppg錼d% Date: 2001-03-19% Version: 1.0% Revision (Name & Date):%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%first_value = 1 + (iteration * block_size); % Elementnumber of first element in data to be extractedlast_value = (iteration + 1) * block_size;number_of_blocks = ceil(length(data) / block_size);if(iteration < number_of_blocks-1) data_block = data(first_value:last_value);elseif(iteration == number_of_blocks-1) number_add = block_size - length(data(first_value:end)); % Number of zeros to add if block_size is not multiple of datalength data_block = [data(first_value:end) zeros(1,number_add)];else data_block = 0;end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -