MATLAB: How to fix “Out of memory” error

Antenna ToolboxMATLABmemory

I'm trying to run some code but I keep recieving the following error:
Error using zmm_solve_metal_c
Out of memory. Type "help memory" for your options.
I've lookeed at other questions answers and tryied a few suggestions, increase java setting, uncheck the box that limits the array size, etc. the same result keeps happening. I'm using a 500GB computer with 150GB of free space reamining so I dont understand why I'm having this problem. I copied the code I'm running below.
%Ship1 Transmit Site
tx = txsite('Name','Ship 1','Latitude',32.7294, 'Longitude',117.6908, 'Antenna',cavityCircular,'AntennaHeight',34, 'SystemLoss',0, 'TransmitterFrequency',6e9, 'TransmitterPower',10)
%Ship2 Recieving Site
rx = rxsite('Name','Ship 2','Latitude',33.0833, 'Longitude',117.9832, 'Antenna',cavityCircular,'AntennaHeight',34, 'SystemLoss',0, 'ReceiverSensitivity',-89)
%Create the propagation model for heavy rainfall rate.
pm = propagationModel('freespace');
%Calculate the range of transmitter using the rain propagation model and a
%path loss of 89 dB. Output is in meters.
r = range(pm,tx, 89)
%Calculate the pathloss at the receiver using the rain propagation model.
pl = pathloss(pm,rx,tx)
%Signal strength
ss = sigstrength(rx,tx,pm)

Best Answer

  • This is likely due to a mismatch between the resonant frequency of the default cavityCircular antenna and the transmitter frequency. To avoid this problem try using the design function with your antenna object to match the transmitter:
    fq = 6e9;
    ant = design(cavityCircular,fq);
    tx = txsite('Name','Ship 1','Latitude',32.7294, 'Longitude',117.6908, ...
    'Antenna',ant,'AntennaHeight',34, ...
    'SystemLoss',0, 'TransmitterFrequency',fq, 'TransmitterPower',10)
    %Ship2 Recieving Site
    rx = rxsite('Name','Ship 2','Latitude',33.0833, 'Longitude',117.9832, ...
    'Antenna',ant,'AntennaHeight',34, ...
    'SystemLoss',0, 'ReceiverSensitivity',-89)
    %Create the propagation model for heavy rainfall rate.
    pm = propagationModel('freespace');
    %Calculate the range of transmitter using the rain propagation model and a
    %path loss of 89 dB. Output is in meters.
    r = range(pm,tx, 89)
    %Calculate the pathloss at the receiver using the rain propagation model.
    pl = pathloss(pm,rx,tx)
    %Signal strength
    ss = sigstrength(rx,tx,pm)