Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

8.3. MATLAB Programming

Programming in MATLAB is very similar to that found in C/C++. In previous chapters, it is observed that MATLAB contains most of the basic programming constructs available in other programming languages. It also has option to define classes and objects as done in other object-oriented languages. But, the most important of all is the ease of programming and the tools available in MATLAB. These enable the programmer to develop large scientific applications with shorter code and in far less time.

Program files in MATLAB are called M-files. These files contain a series of MATLAB statements along with the programming constructs or features like for, while loops or switch, break and if Control statements. As program files in C language have names with extension ‘.c’, MATLAB program files are named with extension ‘.m’. The program files are created or edited using MATLAB Editor and saved by specifying the filename without the extension. The file extension ‘.m’ is appended to the end of the filename automatically.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint