DeepMIMO Forum

Learning Beam Codeb...
Clear all

[Solved] Learning Beam Codebooks in mmWave/THz MIMO System  


Burhan Seker
New Member
Joined: 2 years ago
Posts: 3
20/05/2022 4:59 pm  


I downloaded the simulation codes from the link.

To see the example figure, I followed all steps. However I couldnt get the Fig. 7(c).

At step 5 I run the code: plot_pattern(beams.’) in Matlab Command Window.

But it gives this error. "Error: The input character is not valid in MATLAB statements or expressions." And no figure window appeared.


When I run this code:  plot_pattern('beams.') in Matlab Command Window, it gives

Undefined function or variable 'polarplot'.

Error in plot_pattern (line 15)
polarplot(theta_s, proj(:,n).')

Figure window appeared but it was empty.

What can i do to see the Fig. 7(c)? Am I missing something?

Thanks in advance. Regards.


Yu Zhang
Member Moderator
Joined: 2 years ago
Posts: 2
23/05/2022 6:12 pm  
Hi Burhan,
Thanks for your interest in this work.
Based on your descriptions, it is also hard for me to pinpoint exactly the problem you encountered. However, you might try the following steps to find the reason:
1. After you run the, you might check if there is a folder named 'beams' and if there are .mat files in it. The number of .mat files should be equal to the codebook size, as each .mat is essentially a learned beam.
2. Check if the values in the .mat files make sense.
3. Make sure to run to generate "beam_codebook.mat" file and load it back in Matlab. That will give you a variable called 'beams' in the Matlab workspace that is used by plot_pattern function.
4. I noticed that the single quote you used in "plot_pattern(beams.')" seems not correct. You might double-check that part as well to make sure that it is a valid English character.
5. I am not quite sure why you got "Undefined function or variable 'polarplot'". You might provide your Matlab version to us as well since this function is supposed to be a built-in function in Matlab.
I hope these steps can help you reproduce the figure.

Burhan Seker
New Member
Joined: 2 years ago
Posts: 3
29/05/2022 11:06 pm  

Thank you for your detailed explanation Yu.


I now have the Fig.7(c). MATLAB version was the problem.

PS: "plot_pattern(beams.')" is the correct command. However, on the website under applications (Codebook Learning RL) section, at step 5, the command is plot_pattern(beams.’). apostrophe is different. 


 I  want to plot fig.7(a) as well. How can i get that figure? Any hint would be appreciated.


Thanks again.

Member Admin
Joined: 2 years ago
Posts: 4
03/06/2022 8:32 pm  

Burhan Seker
New Member
Joined: 2 years ago
Posts: 3
05/06/2022 2:37 pm  

I have confused about how can I test their performance on my user channel dataset. Can you be more specific? Since the code execution time is quite long, It will take almost 1 week to reproduce the codebooks with different options['num_NNs'] parameters. 


PS: By the way, your explanation help me get the idea about how to plot figure 9 in the Deep Learning Coordinated Beamforming for Highly-Mobile Millimeter Wave Systems paper. 

Thanks again Yu.

Member Moderator
Joined: 2 years ago
Posts: 19
01/07/2022 6:17 pm  


Leave a reply

Author Name

Author Email

Title *

Maximum allowed file size is 10MB

Preview 0 Revisions Saved