Matlab Code Fixes

Matlab cannot find functions deg2dms and dms2mat

These functions are part of the Matlab mapping toolbox which requires a dedicated toolbox license. Here you can download two functions that substitute these functions from the toolbox: deg2dms.mdms2mat.m. It is recommended to place these functions in the folder “GNSS_SDR/geoFunctions”.

Functions fxcorr, fxcorrBOC11, codephase, multipathBOC and acf_boc are missing

These functions are inside of the files Scurve.m and multEnvBOC.m respectively.

Function PRNgen.m is missing

Use the generateCAcode.m instead (from the “GNSS_SDR/include” folder).

Functions R.m and R_BL.m cannot be found by Matlab

Here are the download links for the two missing functions: R.m, R_BL.m.

The setting “Number of bytes to skip” cannot be set in the settings GUI

A variable is misspelled at line 180 in the file setSettings.m. The text settings.skipNuberOfBytes should be corrected to settings.skipNumberOfBytes.

Software falls into infinite loop after tracking, when 4 channels are selected

The problem occurs in one of the functions for coordinate transformations – the cart2geo.m. The function fails to approximate the height precise enough. The quick fix is to modify the function cart2geo.m as shown here (starting at line 30):

h = 0.1; oldh = 0;
iterations = 0;
while abs(h-oldh) > 1.e-12
   oldh = h;
   N = c/sqrt(1+ex2*cos(phi)^2);
   phi = atan(Z/((sqrt(X^2+Y^2)*(1-(2-f(i))*f(i)*N/(N+h)))));
   h = sqrt(X^2+Y^2)/cos(phi)-N;

   iterations = iterations + 1;
   if iterations > 100
       fprintf('Failed to approximate h with desired precision. h-oldh: %e.\n', h-oldh);

12 thoughts on “Matlab Code Fixes

  1. Currently trying to get satellite clock bias, position and velocity using the code, it seems that there is a bias…

  2. Hi

    Sorry to bother you. I have this book. and I did not see Scurve.m file and multEnvBOC.m file in the DVD. However, it can run and get some result. Does the software need these files? Thanks a lot!

    I also have a question for the SiGe front end, what kind of data format does this front end output to the computer? Thank you very much

    Best Regards

    1. Hi,

      Have you checked the “Figure files” folder? The two functions should be in that folder.

  3. Hello!
    I have the book of Chinese published in 2009, which provides the former version of SDR. I must say it’s so fabulous!
    Now I am working on the vector tracking , and I wonder where I can get the update software or the program of vector tracking?

    1. Hello,

      Dennis Akos has published a vector tracking SDR version on his project homepage at On that homepage open the “Front End Module” page and look for “VLL TRACKING” section in the upper part of the page.

      1. Sorry to bother you again…
        I run the VLL programe using the signal provided in the DVD, but the results of user’s position diverges. I tried a lot to fix it but didn’t work at all… Do you know what’s the problem and how to solve it?

        1. I am sorry, but I did not had a chance to try that VLL code. And at the moment I do not have time to look into this problem.

    1. Hi,

      We have Galileo and GLONASS versions which at the moment are not for publishing.

Leave a Reply

Your email address will not be published. Required fields are marked *