I get this error: Incorrect number or types of inputs or outputs for function 'phaseShift' when I try to compile my code.
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi everyone. Could someone please explain what could be the cause of this error when I use the phaseShift function. Many thanks in advance.
%%Create Variables
clc
clear all
close all
freq = 5.33e9;
c = physconst("lightspeed");
lambda = c/freq;
%%Create pcbStack object
pcbobj = pcbStack;
%%Create board shape
%Creating BoardShape metal layer.
%Creating Rectangle shape.
Rectangle = antenna.Rectangle;
Rectangle.Name = "Rectangle";
Rectangle.Center = [0 0];
Rectangle.Length = 0.02725;
Rectangle.Width = 0.02725;
Rectangle = rotate(Rectangle,0,[Rectangle.Center,-1],[Rectangle.Center,1]);
BoardShape = Rectangle;
pcbobj.BoardShape = BoardShape;
%%Create Stackup
%Creating PatchLayer metal layer.
%Creating Patch shape.
Patch = antenna.Polygon;
Patch.Name = "Patch";
Patch.Vertices = [
-0.00775 0.0064 0;
0.00775 0.0064 0;
0.00775 -0.0064 0;
0.000535 -0.0064 0;
0.000535 -0.0015 0;
0.000375 -0.0015 0;
0.000375 -0.013625 0;
-0.000375 -0.013625 0;
-0.000375 -0.0015 0;
-0.000535 -0.0015 0;
-0.000535 -0.0064 0;
-0.00775 -0.0064 0];
Patch = rotate(Patch,0,[0 -0.00430416666666667 -1],[0 -0.00430416666666667 1]);
PatchLayer = Patch;
%Creating DielectricLayer dielectric layer.
DielectricLayer = dielectric("Name",'Custom',"EpsilonR",4.66,"LossTangent",0.026,"Thickness",0.0006);
%Creating GroundPlane metal layer.
%Creating Ground shape.
Ground = antenna.Rectangle;
Ground.Name = "Ground";
Ground.Center = [0 0];
Ground.Length = 0.02725;
Ground.Width = 0.02725;
Ground = rotate(Ground,0,[Ground.Center,-1],[Ground.Center,1]);
GroundPlane = Ground;
%%Create Feed
% feedloc = [[0 -0.006237 3 1];...
% ];
feedloc = [[0 -0.0064 3 1];...
];
%%Create Metal
metalobj = metal;
metalobj.Name = 'Copper';
metalobj.Conductivity = 5.96e7;
metalobj.Thickness = 35e-6;
pcbobj.Conductor = metalobj;
%%Assign propertie
pcbobj.BoardThickness = 0.00053;
pcbobj.Layers = {PatchLayer,DielectricLayer,GroundPlane,};
pcbobj.FeedLocations = feedloc;
pcbobj.FeedDiameter = 0.00030672;
pcbobj.ViaDiameter = 0.00075;
pcbobj.FeedViaModel = 'strip';
pcbobj.FeedVoltage = 1;
pcbobj.FeedPhase = 0;
figure('Position', [100 750 600 500]);
show(pcbobj)
figure('Position', [700 750 600 500]);
pattern(pcbobj,freq)
figure('Position', [1300 750 600 500]);
current(pcbobj,freq)
% antennaArray = rectangularArray;
antennaArray = phased.URA;
antennaArray.Element = pcbobj;
antennaArray.Size = [10 10];
antennaArray.ElementSpacing = lambda/2;
antennaArray.Lattice = "Rectangular";
antennaArray.ArrayNormal = "x";
figure('Position', [100 150 600 500]);
pattern(antennaArray, freq)
pos_rec = getElementPosition(antennaArray);
pos_yx_rec = pos_rec([2,3],:);
figure('Position', [700 150 600 500]);
plot(pos_yx_rec(1,:), pos_yx_rec(2,:), '.', 'MarkerSize', 10)
% axis([-0.2 0.2 -0.2 0.2])
xlabel('x'); ylabel('y')
title('Rectangular Lattice')
figure('Position', [1300 150 600 500]);
az_angle = -180:0.25:180;
pattern(antennaArray,freq, az_angle, 0, CoordinateSystem="rectangular")
axis([-90 90 -35 25])
ps = phaseShift(antennaArray, freq, [30 45]);
0 commentaires
Réponses (1)
Sarthak
le 30 Mai 2024
Hi Dmitry,
I faced the same issue as well. I think the phaseShift function cannot take an array of type phased.URA. Can you try using a regular rectangularArray?
I used an example from the documentation:
% Works
a = rectangularArray('Size',[3 3]);
ps = phaseShift(a,1.8e9,[30 45])
However,
% Doesn't work
array = phased.URA('Size',[3 3]);
ps = phaseShift(array,1.8e9,[30 45])
Not sure if this is the expected behavior, but worked for me.
Cheers!
Voir également
Catégories
En savoir plus sur Array Geometries and Analysis dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!