Activity Feed › Discussion Forums › Software, CAD & Mapping › Do any of you surveyors use MATLAB

Do any of you surveyors use MATLAB
Posted by OleManRiver on December 23, 2022 at 3:19 amI was wondering if anyone uses MATLAB in their companies as part of any workflows. I used it in another setting and was wondering if anyone uses it at all. It is very powerful and many things can be automated and it can be used with other programs like python etc. Most of what we do is within our cad or survey programs so it is probably not cost effective to have it in a business setting. But as i sit here and relax I was just thinking if it would be justified in purchasing.
aliquot replied 1 year, 6 months ago 6 Members · 10 Replies 
10 Replies

I used Matlab, what is now a long time ago. It is a programming language, so you need to be comfortable with those concepts and its own rules that are not just like C or Basic.
Many useful things can be done with only a few commands. You can enter commands one at a time and see the results, or run full programs.
I liked its ability to customize graphs. Its library includes a large number of higher math functions.
It is especially efficient at quickly making computations on large vectors and arrays if you learn the right syntax to let it work as vectors instead of do loops.
. 
I use GNU Octave, though for nonsurveying calculations. Free. Mostly compatible with MATLAB
Very useful.

@bill93 yes MATLAB is a powerful package. It is used a lot where I worked before and for transformations adjustments and all for orbital science etc. I was just wondering if anyone used it in daily work flows or not. I reckon most software we have today probably has a MATLAB basis built in or similar. Or was used as a check. I have been slowly reading some of the help tools for using python macros to customize some things i. Trimble Business Center. I am no code writer but have used MATLAB and did a little with python. But I had a lot of help from the computer savvy folks doing some things in python. I was thinking of taking a basic python course and such as I have some deliverable reports that are done daily and truly not advanced but was looking at the potential to automate them a bit more. Its those 15 to 30 minutes of workflow that if I could cut down because they are repetitive that would give me double the time on something else. We all know if it takes 10 minutes to do a task itself and That alone gets done often in long run its worth the time savings. And its more time saved than the actual function itself because you have to move in and out to a different project etc. The simple small things add up and from my experience its always the little things that get overlooked that cause the big traffic jam . The 5 minute task cost us hours as an example. But 30 minutes a day over the course of a project adds up.

I used Matlab in school, when I went back for my fouryear degree. It had been a mandated course right up until the year I was set to take it, but I needed another class’ worth of credits so I just went ahead and took it.
I was taking Spatial Data Adjustments II at the same time, so I worked up a Matlab routine that would parse a RW5, extract all the observations and run LSA on it.
I’m not that great at coding, so it’s a testament to how easy Matlab is to work with. I can see the applications for surveying if one did not have access to the industry programs, but it requires not only good coding skills, but knowledge of the underlying math, as well as knowledge of surveying/geomatics.
If I had the money I’d keep Matlab around permanently to play with, but a grand per year is still pretty steep.
“…people will come to love their oppression, to adore the technologies that undo their capacities to think.” Neil Postman 
@rover83 yes for sure. You can do a lot of work on the qa/qc of lidar etc. and other things with MatLab for sure. Remote sensing is a perfect tool for matlab. But then like you stated one must understand the underlying math and understand colors in signature form and numerical value for all colors. That is how I started with remote sensing and such was all about numbers vs colors and signature returns. But i love colors i use to keep color pencils and highlighters to organize field data on plans etc. back when plans were rolled up and rolled out on a hood of a truck etc. i use it still comparing things etc. i see all the folks getting into mobile lidar now. And ortho photogrammetry with drones etc. i see a lot of mistakes and a lot of good practices as well. I need to dive into this myself as it has been a while since i did ortho with imagery and remote sensing msi xray hsi but not much on private sector side. So i need to get my head wrapped around it and see how i can apply what i have done before.

Matlab does have a ??Home license? that is NOT available for government, academic, commercial or other institutional use. Cost is 149USD; Toolboxes are 45USD each.
I have been using it regularly for a couple decades as a professional and as an academic. Since retiring I obtained my own copies. My old 2011 MacBook ran it fine until it topped out at the High Sierra O/S update and became unreliable. Along with my new MacBook Pro M1 chip, I bought a new Home license. Works fine.
While there are a number of functions available in the Mapping Toolbox that could make my work easier, I choose to create my own. There are a number of sources for MatLab scripts and functions. I recommend those developed and posted for ??free? use by Prof Kai Borre. He cowrote with Prof Gil Strang the texts ??Linear Algebra,Geodesy, and GPS? and ??Algorithms for GPS.?
Some of his scripts are available on GitHub here: https://github.com/mfkiwl/borre–easySuite
In addition to the Mapping Toolbox, I would also recommend the Matlab Symbolic Toolbox.
Getting back to the OP, I do not know whether Matlab would fit well within the workflow of most surveying or GPS packages at the local firm level.
There are free Matlablike packages. I have used the Scilab package and found it quite capable. IMO, none of the alternatives are as well integrated.
Link to Matlab products site: https://www.mathworks.com/products.html?s_tid=gn_ps

@geeoddmike Thank you. I did not know about the home license. I new about all the toolbox and such. I might buy the home license just for myself to play with. Thank you for passing the information along.

I have used MATLAB but not for surveying. The calculations for surveying are usually simple enough if the software we already have can’t already do it an excel spreadsheet can handle it fine.

While I imagine your software does the cartesian to geodetic coordinate transformations, doing so via spreadsheet requires more effort (and expertise) than I have ever managed.
Shown below is Prof Kai Borre’s code including multiple reference ellipsoids and formatted output. This problem requires iteration.
Matlab is so much clearer and powerful than spreadsheets. Of course, I gave up on them in the 1990s when many of their functions were shown to be subpar. I imagine they have improved since then.
Last time I bought a car I did create a spreadsheet to explore various options. Choose the right tool for the task…
function [b,l,h] = cart2geo(X,Y,Z,i)%CART2GEO Conversion of Cartesian coordinates (X,Y,Z) to geographical% coordinates (phi,lambda,h) on a selected reference ellipsoid% Choices i of Reference Ellipsoid for Geographical Coordinates% 1. International Ellipsoid 1924% 2. International Ellipsoid 1967% 3. World Geodetic System 1972% 4. Geodetic Reference System 1980% 5. World Geodetic System 1984%Kai Borre 101398%Copyright (c) by Kai Borre%$Revision: 1.0 $ $Date: 1998/10/23 $a = [6378388 6378160 6378135 6378137 6378137];f = [1/297 1/298.247 1/298.26 1/298.257222101 1/298.257223563];lambda = atan2(Y,X);ex2 = (2f(i))*f(i)/((1f(i))^2);c = a(i)*sqrt(1+ex2);phi = atan(Z/((sqrt(X^2+Y^2)*(1(2f(i)))*f(i))));h = 0.1; oldh = 0;while abs(holdh) > 1.e12oldh = h;N = c/sqrt(1+ex2*cos(phi)^2);phi = atan(Z/((sqrt(X^2+Y^2)*(1(2f(i))*f(i)*N/(N+h)))));h = sqrt(X^2+Y^2)/cos(phi)N;endphi = phi*180/pi;b = zeros(1,3);b(1) = fix(phi);b(2) = fix(rem(phi,b(1,1))*60);b(3) = (phib(1,1)b(1,2)/60)*3600;lambda = lambda*180/pi;l = zeros(1,3);l(1) = fix(lambda);l(2) = fix(rem(lambda,l(1,1))*60);l(3) = (lambdal(1,1)l(1,2)/60)*3600;fprintf(‘n phi =%3.0f %3.0f %8.5f’,b(1),b(2),b(3))fprintf(‘n lambda =%3.0f %3.0f %8.5f’,l(1),l(2),l(3))fprintf(‘n h =%14.3fn’,h)%%%%%%%%%%%%%% end cart2geo.m %%%%%%%%%%%%%%%%%%% 
@geeoddmike yes these days survey specific software makes it just button pushing. Matlab is definitely more powerful than Excell, but you can do a lot with Excell, especially if you have a little programing experience. When I first started working for a surveyor I did a set of transformations from state plane to geodetic with Excell, because Carlson hadn’t added the capability to deal with geodetic bearings yet.
For the very heavy stuff I used FORTRAN.
Log in to reply.