Error: Unsupported use of the '=' operator. To compare values for equality, use '=='. To specify name-value arguments, check that name is a valid identifier with no surroundin

27 views (last 30 days)
o meu codigo esta aparecendo o seguinte erro " macroLongitudes = Error: Unsupported use of the '=' operator. To compare values for equality, use '=='. To specify name-value arguments, check that
name is a valid identifier with no surrounding quotes." e nao estou conseguindo entender.
meu codigo:
clear all
% os nomes, latitudes e longitudes dos sites macro
macroNames = 'Jaguaribe-CE';
macroLats = [-5.895806113892169, -5.895456726608638, -5.894977218173506, -5.894574146873162, -5.894012923262541, -5.892195776533852, -5.893724989565935, -5.893422140221246, -5.893179919279051, -5.891977116775971, -5.891327135596663, -5.890686880351645, -5.890334042764228, -5.88983837399142, -5.889336924040441, -5.888744071891002, -5.888533609006252, -5.887945934165032, -5.887543850547718, -5.887128651252049, -5.886943880936919, -5.886364345327938, -5.886062306664483, -5.885766871568715, -5.884309722326146, -5.882746625208792, -5.897673302095725, -5.897242180363128, -5.897096386494342, -5.895797809946615, -5.89647119592621, -5.898944464436658, -5.899108814427524, -5.899211601541639, -5.897592386557939, -5.900607816407843, ...]; % Substitua por suas latitudes
macroLongitudes = [-38.62032597572306, -38.62222432683183, -38.62401029975932, -38.62572184096341, -38.61992246343461, -38.61949160816766, -38.62171951032668, -38.62353991951861, -38.62534465645687, -38.62183896183396, -38.62349527110939, -38.62515847993476, -38.61920861630935, -38.62100078740404, -38.62278620093045, -38.6244031296015, -38.61873463402229, -38.62059149583992, -38.62235041743411, -38.6240154411265, -38.61781416873151, -38.61951523232732, -38.62102304397499, -38.62282491171222, -38.62206339127928, -38.62171264679774, -38.62062239383805, -38.62256024259663, -38.62432019268199, -38.62584639431048, -38.62764918344993, -38.6227883483316, -38.62461497937137, -38.62130285989428, -38.62632327961818, -38.62315936981273, ...]; % Substitua por suas longitudes
centerSite = geopoint(-5.895806113892169, -38.62032597572306); % Substitua por sua latitude e longitude
% Initialize arrays for distance and angle from center location to each cell site, where
% each site has 3 cells
numCellSites = 36;
siteDistances = zeros(1,numCellSites);
siteAngles = zeros(1,numCellSites);
% Define distance and angle for inner ring of 6 sites (cells 4-21)
isd = 200; % Inter-site distance
siteDistances(2:7) = isd;
siteAngles(2:7) = 30:60:360;
% Define distance and angle for middle ring of 6 sites (cells 22-39)
siteDistances(8:13) = 2*isd*cosd(30);
siteAngles(8:13) = 0:60:300;
% Define distance and angle for outer ring of 6 sites (cells 40-57)
siteDistances(14:19) = 2*isd;
siteAngles(14:19) = 30:60:360;
% Initialize arrays for cell transmitter parameters
numCells = numCellSites*3;
cellLats = zeros(1,numCells);
cellLons = zeros(1,numCells);
cellNames = strings(1,numCells);
cellAngles = zeros(1,numCells);
% Define cell sector angles
cellSectorAngles = [30 150 270];
% For each cell site location, populate data for each cell transmitter
cellInd = 1;
for siteInd = 1:numCellSites
% Compute site location using distance and angle from center site
[cellLat,cellLon] = location(centerSite, siteDistances(siteInd), siteAngles(siteInd));
% Assign values for each cell
for cellSectorAngle = cellSectorAngles
cellNames(cellInd) = "Cell " + cellInd;
cellLats(cellInd) = cellLat;
cellLons(cellInd) = cellLon;
cellAngles(cellInd) = cellSectorAngle;
cellInd = cellInd + 1;
end
end
macroantHeight = 10; % m
macrofq = 3.5e9; % Frequência do portador (4 GHz) para Dense Urban-eMBB
macroTxPower = 10.^((44-30)/10); % Converta dBm para W
% Define transmitter parameters using Table 8-2 (b) of Report ITU-R M.[IMT-2020.EVAL]
%fq = 3.5e9; % Carrier frequency (4 GHz) for Dense Urban-eMBB
%antHeight = 10; % m
%txPowerDBm = 44; % Total transmit power in dBm
%txPower = 10.^((txPowerDBm-30)/10); % Convert dBm to W
macroAngles = [30, 45, 60];
% Crie sites de transmissão de células
% Crie sites de transmissão de células
macro = txsite('Name', macroNames, ...
'Latitude', macroLats, ...
'Longitude', macroLongitudes, ... % Corrigido aqui
'AntennaAngle', macroAngles, ...
'AntennaHeight', macroantHeight, ...
'TransmitterFrequency', macrofq, ...
'TransmitterPower', macroTxPower);
% Launch Site Viewer
viewer = siteviewer;
% Show sites on a map
show(txs);
viewer.Basemap = 'topographic';

Answers (1)

Stephen23
Stephen23 on 29 Jan 2024
Edited: Stephen23 on 29 Jan 2024
Get rid of the ellipses inside the square brackets of both macroLats and macroLongitudes:
macroLats = [lots of numbers, -5.900607816407843, ...]; % Substitua por suas latitudes
macroLongitudes = [lots of numbers, -38.62315936981273, ...]; % Substitua por suas longitudes
% ^^^^^ delete these
  2 Comments
Vinicio
Vinicio on 30 Jan 2024
fiz isso e deu certo , porem agora está aparecendo o erro ''Unrecognized function or variable 'location'.
Stephen23
Stephen23 on 30 Jan 2024
To use the TXSITE function and LOCATION method:
you will need to have the Communications Toolbox installed and a valid license for it.
Check your installation using VER and check your licenses to make sure that you can use it.

Sign in to comment.

Categories

Find more on RF Propagation in Help Center and File Exchange

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!