Rank: 698 based on 99 downloads (last 30 days) and 9 files submitted
photo

Adam Leadbetter

E-mail
Company/University
BODC
Lat/Long
53.4082, -2.9689

Personal Profile:

I work as a marine data scientist at the British Oceanographic Data Centre and have used Matlab for data formating, visualisation and for environmental modelling for about a decade.

Professional Interests:
Oceanography

 

Watch this Author's files

 

Files Posted by Adam View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
12 Oct 2010 Screenshot invoerr Improved invocation error reporting for Matlab functions Author: Adam Leadbetter error reporting 1 0
21 Sep 2010 Screenshot Radar-like Plot Plot a radar-like display from distance and direction vectors. Author: Adam Leadbetter graphing 14 0
15 Mar 2010 NMEA 0183 Sentence Reader Reads a NMEA 0183 sentence into a Matlab structure. Author: Adam Leadbetter nmea, gps, earth science, data import 45 4
  • 4.0
4.0 | 1 rating
14 May 2009 Percent Done Displays the percentage done of a job to the command line interface. Author: Adam Leadbetter programming, interface, waitbar, percent done 10 3
  • 5.0
5.0 | 3 ratings
13 May 2009 Screenshot plotgantt Plot a Gantt chart from a Matlab structure. Author: Adam Leadbetter data export, project planning, plotting, project management 10 2
  • 3.0
3.0 | 1 rating
Comments and Ratings by Adam View all
Updated File Comments Rating
24 Mar 2011 Web Server HTTP Matlab Web Server, allows m-files to be executed in a browser Author: Dirk-Jan Kroon

Very nice piece of code. It works very well for me.

22 Dec 2009 NMEA 0183 Sentence Reader Reads a NMEA 0183 sentence into a Matlab structure. Author: Adam Leadbetter

Hi Febri,

Sorry for a slow reply

As per the help file:

The input is a Matlab string, as output by an NMEA instrument.
Currently I have implemented $GPGGA, $GPVTG, $GPZDA and $SDDBS stings.

You will get back a structure with different values (as described in the help file), and can return an error code for code diagnostics.

Any more questions, fell free to ask,

Adam

Comments and Ratings on Adam's Files View all
Updated File Comment by Comments Rating
19 Aug 2011 Percent Done Displays the percentage done of a job to the command line interface. Author: Adam Leadbetter MechtEngineer

Fantastic program. It does exactly what it says it does. Extremely easy to insert into a for loop and get an update on the progress through the for loop in real-time.

I just made a few changes:
1. The first time the program is run, the persistent variable 'lastCall' is empty, and so the "Percentage Complete" line displayed inside previous text I had printed to the workspace. So I just added a catch, which sets lastCall to -1 on the very first run, and that means the first time the function 'perccount' is run, the "Percentage Complete" line is displayed correctly.

2. I modified the last check (which checks whether the progress is complete) from
fprintf(1,'\n\n');
to
fprintf(1,'\b\b\b100%%\n\n');
This means the displayed line ends up showing "Percentage Complete: 100%" rather than "Percentage Complete: 99%", which is untrue - everything has completed properly!

3. A program without good commenting makes it very difficult to use and understand for other programmers. A description of the required variables used by the function at the start of the code helps a huge amount, and Adam, you did this very nicely! But if I want to understand how the program works, then it really helps to have some commenting through the code.

The code I am now running is:

function perccount(jj,maxjj)

%Reports the percentage of the job done to the screen.
%
% PERCOUNT(I,Imax)
% I is the current iteration between 1 and Imax
% Imax is the maximum number of iterations
%
% Do not print anything to the screen between calls of this function!
%

% title - s cmspike/perccount vr - 1.2
% author - bodc/alead date - 2006may16

% Updated 2009May14
% At suggestion of John D'Errico renamed internal variable "max" to
% "maxjj"
% Also following D'Errico's suggestions the following functionality has
% been added:
% 1. An invocation check - checks that two input arguments are
% supplied

% lastCall is the last integer percent displayed
persistent lastCall;
% if the number of arguments is 2
if(nargin == 2)
    % if this is the first run, make lastCall a value that will get the
    % following if loops working from the start.
    if isempty(lastCall)
        lastCall = -1;
    end
    % if the percentage has increased to the next integer, then the
    % displayed percentage will need to be updated
    if(lastCall ~= floor(((jj-1)/maxjj) * 100))
        % if the progress so far (jj out of maxjj) is not the first
        % representation, then backspace the percentage area to prepare for
        % the next percentage update.
        if(jj ~= 1)
            fprintf(1,'\b\b\b');
        % if the progress so far IS the first time it is displayed, then
        % display the "context line" of the percentage.
        else
            fprintf(1,'\n\tPercentage complete: ');
        end
        % Calculate the percentage done
        pc_done = num2str(floor(((jj-1)/maxjj) * 100));
        % if the percentage done so far is in the single digit range
        % (between 0 and 10), then add a zero before it so the percentage
        % displays neatly
        if(length(pc_done) == 1)
            pc_done(2) = pc_done(1);
            pc_done(1) = '0';
        end
        fprintf(1,'%s%%',pc_done);
    end
    
    lastCall = floor(((jj-1)/maxjj) * 100); % the last int percent displayed
    % if this is the last part of the total, then display 100% complete and
    % add a few lines of whitespace for neatness
    if(jj == maxjj)
        fprintf(1,'\b\b\b100%%\n\n');
    end
else
    error('Error: PERCCOUNT needs two input arguments...');
end

One final suggestion: Perhaps change the function to percentComplete.m, or percentDone.m, as this makes more sense than perccount.m, but that's entirely up to you!

30 May 2011 plotgantt Plot a Gantt chart from a Matlab structure. Author: Adam Leadbetter Yi, Yi gang
10 Jul 2010 SSH From Matlab Run commands on a remote machine from a Matlab session, via a secure shell Author: Adam Leadbetter Freedman, David

Don't despair Ahmet, the inspired SSH From Matlab (updated) + SFTP, mentioned in the Acknowledgments, uses the forked Ganymed SSH-2 java library

05 Jul 2010 SSH From Matlab Run commands on a remote machine from a Matlab session, via a secure shell Author: Adam Leadbetter DINDAR, AHMET ANIL

Today (Jul. 5,2010),what I've seen on the referred we page is the following;
"Trilead SSH .NET
Trilead SSH .NET
Trilead will no longer sale the SSH .NET Library to the public.
We recommend the Dart Communcations PowerTCP SSH and SFTP. If you have any questions related the SSH Library, don't hesitate to contact us.

Trilead SSH for Java
Trilead SSH for Java The freely available open-source library won't be anymore developed nore supported by Trilead."

It seems we are at the end.

Ahmet Anil Dindar

03 Feb 2010 NMEA 0183 Sentence Reader Reads a NMEA 0183 sentence into a Matlab structure. Author: Adam Leadbetter Delaney, Kevin J.

Nicely done! Just what I needed.

Top Tags Applied by Adam
data export, plotting, data import, communications, data visualisation
Files Tagged by Adam View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
18 Oct 2011 Screenshot Web Server HTTP Matlab Web Server, allows m-files to be executed in a browser Author: Dirk-Jan Kroon http, php, firefox, web server, webserver, apache 50 9
  • 5.0
5.0 | 5 ratings
12 Oct 2010 Screenshot invoerr Improved invocation error reporting for Matlab functions Author: Adam Leadbetter error reporting 1 0
21 Sep 2010 Screenshot Radar-like Plot Plot a radar-like display from distance and direction vectors. Author: Adam Leadbetter graphing 14 0
15 Mar 2010 NMEA 0183 Sentence Reader Reads a NMEA 0183 sentence into a Matlab structure. Author: Adam Leadbetter nmea, gps, earth science, data import 45 4
  • 4.0
4.0 | 1 rating
14 May 2009 Percent Done Displays the percentage done of a job to the command line interface. Author: Adam Leadbetter programming, interface, waitbar, percent done 10 3
  • 5.0
5.0 | 3 ratings

Contact us at files@mathworks.com