Data Formatting for patternCustom function

15 views (last 30 days)
I am trying to use the patternCustom function to plot a radiation pattern of some data that I have. My data is in the form of three Nx1 vectors: theta, phi, and magnitude where magnitude is a function of theta and phi. The documentation on the patternCustom function here: https://www.mathworks.com/help/antenna/ref/patterncustom.html claims that this is an acceptable format for the data, but when I try to run it with this data, I get a blank plot.
Alternatively, the function successfully generates a plot when I instead give it an arbitrary NxN matrix for the magnitude. (For example, if I just copy my magnitude vector N times using repmat to make a matrix, but the pattern this produces is clearly nonsensical.)
Firstly, I don't understand the meaning of this NxN matrix and how each value in it relates to the values in the theta and phi vectors. Clearly it is not the case that each magnitude value corresponds to one set of theta and phi in the same way that my original data does.
Secondly, I would like to know if there is a way I can meaningfully convert my Nx1 vector into an NxN matrix that would preserve the pattern that I want to plot and successfully generate a plot with this function.
I appreciate advice anyone can give!

Answers (1)

Raghunathraju
Raghunathraju on 28 Apr 2023
Hi,
For plotting patternCustom ,the data needs to be as below format ,
load data.mat
phi=data(:,1)
phi = 2700×1
-175 -170 -165 -160 -155 -150 -145 -140 -135 -130
theta=data(:,2)
theta = 2700×1
180 180 180 180 180 180 180 180 180 180
MageE=data(:,3)
MageE = 2700×1
-1.1133 -1.1133 -1.1133 -1.1133 -1.1133 -1.1133 -1.1133 -1.1133 -1.1133 -1.1133
patternCustom(MageE,theta,phi)

Categories

Find more on Import, Export, and Visualization in Help Center and File Exchange

Products


Release

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!