ArticleslgStudy

science

MLAB

MLAB is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand MLAB rather than just read about it. In short: MLAB (Modeling LABoratory) is a multi-paradigm numerical computing environment and fourth-generation programming language was originally developed at the National Institutes of Health. A proprietary programming language developed by Civilized Software, Inc., MLAB allows matrix manipulations, plotting of functions and data, and implementation of algorithms, and provides support for curve-fitting, differential equatio…

MLAB — main illustration
MLAB — illustration

Key takeaways

  • MLAB belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect MLAB to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of MLAB from memory before moving on to harder problems.

Reference excerpt

MLAB (Modeling LABoratory) is a multi-paradigm numerical computing environment and fourth-generation programming language was originally developed at the National Institutes of Health. A proprietary programming language developed by Civilized Software, Inc., MLAB allows matrix manipulations, plotting of functions and data, and implementation of algorithms, and provides support for curve-fitting, differential equations, statistics and graphics. MLAB is intended for numerical computing, with special facilities for ordinary differential equation-solving (ODE-solving) and curve-fitting (non-linear regression.) It provides more than thirty command types and more than 450 built-in functions from the areas of elementary mathematics, transcendental functions, probability and statistics, linear algebra, optimization, cluster analysis, combinatorics, numeric input/output, and graphics. The usual low-level functions, e.g. sine, cosine, log, etc., are present, as well as functions performing more complex analyses, such as singular value decomposition, discrete Fourier transforms, solution of differential equation systems, non-parametric modeling and constrained non-linear optimization, among many others. A substantial collection of statistically oriented functions, such as most common distribution functions and their inverses, are included, as well as robust graph creation features, supporting graphing of exceptionally complex functions. Many software packages can integrate ordinary differential equations numerically, but MLAB is one of the very few that also can adjust parameters and initial conditions. MLAB is equally facile at handling curve fitting, where the adjustments are linear or, as is the case with most differential equation models, nonlinear. MLAB is widely used in academic and research institutions as well as industrial enterprises.

History MLAB was originally developed at the National Institute of Health in the late 1970s using Stanford's SAIL running on Digital Equipment Corporation (DEC) PDP-10 computers. The creators of MLAB founded Civilized Software, Inc. in 1985 and expanded MLAB in the late 1980s and early 1990s through the application of Small Business Innovation Research grants. MLAB was first adopted by researchers and practitioners in biochemistry, but quickly spread to many other domains. It is now also used in education, in particular the teaching of linear algebra, numerical analysis, and is popular amongst scientists involved in chemical kinetics analysis and modeling and compartmental modeling in pharmacological (including pharmacokinetics) and physiological research.

Syntax The MLAB application is built around the MLAB scripting language. Common usage of the MLAB application involves using the Command Window as an interactive mathematical or executing text (script) files containing MLAB code. There are dozens of MLAB commands and hundreds of MLAB functions. In essence, MLAB is an interpreter for a high-level mathematical language with the ability to process re-runnable script files called do-files.

Example In MLAB one can define a function and graph it as follows.

function f(x) = a*cos(b*x)*exp(-k*x) a = 1; b=4; k =.5 v=1:10!100 m= points(f,v) draw m view

The result is a simple plot:

Note that 1:10!100 = 1:10:0.0909090909, which means that we are dealing with a column vector of values from 1 to 10 in steps of size 0.0909090909 Also, note that points(f,v) = v&'(f on v), and that v$'(f on v) means the column-wise concatenation of the matrix v with the same-sized column vector consisting of the values of f computed on the values in v. One can read-in 110 data values from a file into a 2-column matrix as follows (the result is a 55 row by 2 column matrix.)

d = read("filename",55,2)

Taking the rows of the matrix d as (x,y) data-points - with error in the y-values - where these data points are "modeled" by the function f, defined above, one can estimate the unknown parameters a,b,k as follows.

fit(a,b,k), f to d

One can use estimated weights for the various data points in d based on a moving-variance estimation function ewt as follows.

fit(a,b,k), f to d with wt ewt(d)

One can graph the data and the "fit" as follows.

delete w /* to discard any previous picture */ draw d linetype none, pointtype circle draw points(f,d col 1) color green view

One can look at the symbolic derivative of f and graph it as follows.

type f'x draw points(f'x, d col 1) color red view

Note that MLAB can use symbolic-derivatives when derivative values are needed during curve-fitting, or solving ODEs. Also, note that one can fit (or just solve) differential-equation-defined models in MLAB, so that chemical kinetics and physiological and compartmental models can be handled.

See also List of numerical-analysis software

References

External links Official website

Illustrations

MLAB illustration
MLAB illustration

Worked examples

Example 1 — a first encounter with MLAB

Start with the simplest possible case. Write down what MLAB claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to MLAB before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about MLAB ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of MLAB

In research
MLAB appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses MLAB in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
MLAB is common in secondary-school and first-year university syllabi. It links to neighbouring topics Programming languages created in 1985, so understanding it makes those chapters shorter.
In everyday life
Look for MLAB outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “MLAB” →

How to study MLAB in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what MLAB means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain MLAB out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is MLAB in simple terms?

MLAB (Modeling LABoratory) is a multi-paradigm numerical computing environment and fourth-generation programming language was originally developed at the National Institutes of Health. A proprietary programming language developed by Civilized Software, Inc., MLAB allows matrix manipulations, plotti…

Why does MLAB matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study MLAB?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on MLAB.

Tags

  • Programming languages created in 1985

Keep exploring