MathWorks - Mobile View
  • Accedere al proprio MathWorks AccountAccedere al proprio MathWorks Account
  • Access your MathWorks Account
    • Il Mio Account
    • Il mio Profilo utente
    • Associa Licenza
    • Disconnettiti
  • Prodotti
  • Soluzioni
  • Università
  • Assistenza
  • Community
  • Eventi
  • Acquista MATLAB
MathWorks
  • Prodotti
  • Soluzioni
  • Università
  • Assistenza
  • Community
  • Eventi
  • Acquista MATLAB
  • Accedere al proprio MathWorks AccountAccedere al proprio MathWorks Account
  • Access your MathWorks Account
    • Il Mio Account
    • Il mio Profilo utente
    • Associa Licenza
    • Disconnettiti

Video e Webinar

  • MathWorks
  • Video
  • Home Video
  • Cerca
  • Home Video
  • Cerca
  • Contattaci
  • Software di prova
  Register to watch video
  • Description
  • Full Transcript
  • Related Resources

Programming and Developing Algorithms with MATLAB

Kevin Cohan, MathWorks

Write programs and develop algorithms using the high-level language and development tools in MATLAB®.

MATLAB provides a high-level language and development tools that let you quickly write MATLAB programs, develop and analyze algorithms, and build applications. MATLAB is a matrix-based language. It natively supports vector and matrix operations that are fundamental to engineering and scientific problems.

For example, you can operate on all of the elements in a matrix with a single command without having to write a for loop. As a result, one line of MATLAB code often replaces several lines of C or C++ code.

MATLAB provides features of traditional programming languages, including flow control, such as while and for loops; error handling, such as try catch blocks which allow us to execute statements and catch the resulting errors; and object-oriented programming. Here you can see a class defined in MATLAB together with its properties and methods.

The MATLAB environment is well suited for algorithm design and exploration. In this example, we're developing an algorithm to identify the center of a hurricane. Because MATLAB is a high-level language there's no need to perform low-level administrative tasks, such as declaring variables, specifying data types, and allocating memory.

Using the Command window, you can execute commands one at a time, providing you with immediate results. This interactive approach makes it easy to quickly explore multiple options and iterate to an optimal solution.

You can create a MATLAB script or function from the commands you've already entered. This makes it easy to reuse and automate your work. MATLAB provides built-in algorithms for signal processing and communications, image and video processing, control systems, and many other domains. Here, we're using a function from Image Processing Toolbox™ to identify and measure properties of connected regions in an image.

MATLAB provides development tools that help you implement your algorithms efficiently and optimize their performance. The MATLAB editor is where you create and edit programs. The editor provides debugging features. You can set breakpoints, examine variable values, and step through individual lines of code.

The Code Analyzer automatically checks code in the MATLAB editor for problems. When you hover over underlined code fragments, the Code Analyzer provides an explanation of the problem and suggestions on how to fix it. The MATLAB Profiler measures the overall performance of MATLAB programs and identifies areas of code to focus on for improvement. The Profile Summary report gives information about the functions called, including the time each function took to run, how many times each function was called, and which lines of code took the most processing time.

You can integrate your MATLAB applications with those written in other languages, such as C, C++, Java, and .NET. Here we have C code for a 2D Gaussian function. This code was compiled into a MEX function, or MATLAB executable, and can be called directly from within MATLAB. Similarly, you can call MATLAB code directly from your C, C++, or FORTRAN applications.

MATLAB uses processor-optimized libraries for fast execution of matrix and vector computations. Many linear algebra and numerical functions are multi-threaded, allowing them to run faster on multicore computers. You can use the high-level constructs found in the parallel computing products to parallelize your applications with only minor code changes. This allows you to take further advantage of multicore desktops and other resources, such as GPUs and clusters. With MATLAB you can easily transform your ideas into algorithms and complex applications.

For more information about MATLAB, see the product page or watch one of the other videos.

Related Products

  • MATLAB

Feedback

Featured Product

MATLAB

  • Request Trial
  • Get Pricing

Up Next:

32:43
Developing Algorithms for ADAS Systems with MATLAB and...

Related Videos:

45:46
Programming with MATLAB
27:32
Fostering Independent Learning and MATLAB Programming...
1:40
Industrial Robot Programming with MATLAB and Simulink
1:02:06
What's New for Object-Oriented Programming in MATLAB

View more related videos

MathWorks - Domain Selector

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

Select web site

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Americas

  • América Latina (Español)
  • Canada (English)
  • United States (English)

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
    • 简体中文Chinese
    • English
  • 日本Japanese (日本語)
  • 한국Korean (한국어)

Contact your local office

  • Contattaci
  • Software di prova

Scopri i nostri prodotti

  • MATLAB
  • Simulink
  • Software per studenti​
  • Supporto hardware
  • File Exchange

Prova o Acquista

  • Download
  • Software di prova
  • Contattaci
  • Prezzi e licenze
  • Come acquistare

Impara ad utilizzare i nostri prodotti

  • Documentazione
  • Tutorial
  • Esempi
  • Video e Webinar
  • Formazione

Ricevi supporto tecnico

  • Aiuto all'installazione
  • Risposte​
  • Consulenza
  • License Center
  • Contatta l'assistenza

Informazioni su MathWorks

  • Lavora con noi
  • Sala stampa
  • Missione sociale​
  • Contattaci
  • Informazioni su MathWorks

MathWorks

Accelerating the pace of engineering and science

MathWorks è leader nello sviluppo di software per il calcolo matematico per ingegneri e ricercatori

Scopri…

  • Select a Web Site United States
  • Brevetti
  • Marchi
  • Informativa sulla privacy
  • Antipirateria
  • Stato dell'applicazione

© 1994-2021 The MathWorks, Inc.

  • Facebook
  • Twitter
  • Instagram
  • YouTube
  • LinkedIn
  • RSS

Unisciti alla discussione