DeepMIMO Forum

Error in DeepMIMO_D...
Clear all

[Solved] Error in DeepMIMO_Dataset_Generator

New Member
Joined: 11 months ago
Posts: 1
Topic starter  

I am in my first steps to simulate channel mapping codes in my laptop but I have faced a problem in the 2nd step in this requirement:
Reproducing The Figure:
1- Generate a dataset for scenario I1_2p4 using the settings in the table above--number of paths should be 1.
2- Organize the data into a MATLAB structure named "rawData" with the following fields: channel and userLoc. "channel" is a 3D array with dimensions: # of antennas X # of sub-carriers X # of users while "userLoc" is a 2D array with dimensions: 3 X # of users.
3- Save the data structure into a .mat file.
4- In the file main, set the option: options.rawDataFile1 to point to the .mat file.
5- Run main.m

I have also faced the below error 

DeepMIMO Dataset Generation started
Reading the channel parameters of the ray-tracing scenario I1_2p4 - Percent done: 0.0Error using read_raytracing
Too many input arguments.

Error in DeepMIMO_generator (line 37)

Error in DeepMIMO_Dataset_Generator (line 35)


I hope you could guide me through this error. Thanking you in advance!

Member Moderator
Joined: 1 year ago
Posts: 38

Please use the following code to organize the data and save it for step 3.

%% % ----------------- Add the path of DeepMIMO function --------------------%

%% % -------------------- DeepMIMO Dataset Generation -----------------------%
% Load Dataset Parameters
dataset_params = read_params('parameters.m');
[DeepMIMO_dataset, dataset_params] = DeepMIMO_generator(dataset_params);

%% Create the structure and save the dataset
num_antennas = length(dataset_params.active_BS);
num_OFDM_subc = size(DeepMIMO_dataset{1}.user{1}.channel, 3);
num_users = length(DeepMIMO_dataset{1}.user);
channel = zeros(num_antennas, num_OFDM_subc, num_users);
userLoc = zeros(3, num_users);

for j = 1:num_antennas
    for i = 1:num_users
       channel(j, :, i) = DeepMIMO_dataset{j}.user{i}.channel(1, 1, :);
       userLoc(:, i) = DeepMIMO_dataset{j}.user{i}.loc;
end = channel;
rawData.userLoc = userLoc;

% The saved file is ready for running the channel mapping main script.
save('DeepMIMO_dataset/channelmapping_singlepath.mat', 'rawData', '-v7.3'); 

For this code, the "parameters.m" file should be set as follows:

%%%% DeepMIMO parameters set %%%%
% A detailed description of the parameters is available on

%Ray-tracing scenario
params.scenario = 'I1_2p4';          % The adopted ray tracing scenario [check the available scenarios at ]

%Dynamic Scenario Scenes [only for dynamic (multiple-scene) scenarios]
params.scene_first = 1;
params.scene_last = 1;

% Active base stations
params.active_BS = [1:64];             % Includes the numbers of the active BSs (values from 1-18 for 'O1')(check the scenario description at  for the BS numbers) 

% Active users
params.active_user_first = 1;       % The first row of the considered user section (check the scenario description for the user row map)
params.active_user_last = 502;        % The last row of the considered user section (check the scenario description for the user row map)

% Subsampling of active users
%--> Setting both subsampling parameters to 1 activate all the users indicated previously
params.row_subsampling = 1;         % Randomly select round(row_subsampling*(active_user_last-params.active_user_first)) rows
params.user_subsampling = 1;        % Randomly select round(user_subsampling*number_of_users_in_row) users in each row

% Antenna array dimensions
params.num_ant_BS = [1, 1, 1];      % Number of antenna elements for the BS arrays in the x,y,z-axes
% By defauly, all BSs will have the same array sizes
% To define different array sizes for the selected active BSs, you can add multiple rows. 
% Example: For two active BSs with a 8x4 y-z UPA in the first BS and 4x4
% x-z UPA for the second BS, you write  
% params.num_ant_BS = [[1, 8, 4]; [1, 4, 4]];

params.num_ant_UE = [1, 1, 1];      % Number of antenna elements for the user arrays in the x,y,z-axes

% Antenna array orientations
params.activate_array_rotation = 0; % 0 -> no array rotation - 1 -> apply the array rotation defined in params.array_rotation_BS and params.array_rotation_UE
params.array_rotation_BS = [5, 10, 20];         
% 3D rotation angles in degrees around the x,y,z axes respectively
% The origin of these rotations is the position of the first BS antenna element
% The rotation sequence applied: (a) rotate around z-axis, then (b) rotate around y-axis, then (c) rotate around x-axis. 
% To define different orientations for the active BSs, add multiple rows..
% Example: For two active BSs with different array orientations, you can define
% params.array_rotation_BS = [[10, 30, 45]; [0, 30, 0]];

params.array_rotation_UE = [0, 30, 0];      
% User antenna orientation settings
% For uniform random selection in
% [x_min, x_max], [y_min, y_max], [z_min, z_max]
% set [[x_min, x_max]; [y_min, y_max]; [z_min, z_max]]
% params.array_rotation_UE = [[0, 30]; [30, 60]; [60, 90]]; 

params.enable_BS2BSchannels = 0;      % Enable generating BS to BS channel (could be useful for IAB, RIS, repeaters, etc.) 

% Antenna array spacing
params.ant_spacing_BS = .5;           % ratio of the wavelength; for half wavelength enter .5
params.ant_spacing_UE = .5;           % ratio of the wavelength; for half wavelength enter .5

% Antenna element radiation pattern
params.radiation_pattern = 0;         % 0: Isotropic and 
                                      % 1: Half-wave dipole
% System parameters
params.bandwidth = 0.02;              % The bandwidth in GHz
params.activate_RX_filter = 0;        % 0 No RX filter 
                                      % 1 Apply RX low-pass filter (ideal: Sinc in the time domain)

% Channel parameters # Activate OFDM
params.generate_OFDM_channels = 1;    % 1: activate frequency domain (FD) channel generation for OFDM systems
                                      % 0: activate instead time domain (TD) channel impulse response generation
params.num_paths = 1;                 % Maximum number of paths to be considered (a value between 1 and 25), e.g., choose 1 if you are only interested in the strongest path

% OFDM parameters
params.num_OFDM = 64;                % Number of OFDM subcarriers
params.OFDM_sampling_factor = 1;      % The constructed channels will be calculated only at the sampled subcarriers (to reduce the size of the dataset)
params.OFDM_limit = 16;               % Only the first params.OFDM_limit subcarriers will be considered  

params.saveDataset = 0;               % 0: Will return the dataset without saving it (highly recommended!) 


This post was modified 11 months ago 3 times by udemirhan

Active Member
Joined: 11 months ago
Posts: 4


Hi, during the running of the code of (main), I have gotten this error :

Arrays have incompatible sizes for this operation.

Error in dataPrep (line 91)
X1 = mask.*x(:,1:options.numOfSub,2);

Error in main (line 55)
[dataset,options] = dataPrep(, options);

Member Moderator
Joined: 1 year ago
Posts: 38

Hi Osos,

Can you make sure you are running the exact code downloaded from Github repository? At line 91, instead of

X1 = mask.*x(:,1:options.numOfSub,2);

we have the following.

X1 = mask.*x(:,1:options.numOfSub,:);





This post was modified 4 months ago by udemirhan


Leave a reply

Author Name

Author Email

Title *

Maximum allowed file size is 2MB

Preview 0 Revisions Saved