Author: admin
-
Data Types
Perl is a loosely typed language and there is no need to specify a type for your data while using in your program. The Perl interpreter will choose the type based on the context of the data itself. Perl has three basic data types: scalars, arrays of scalars, and hashes of scalars, also known as…
-
Syntax Overview
Perl borrows syntax and concepts from many languages: awk, sed, C, Bourne Shell, Smalltalk, Lisp and even English. However, there are some definite differences between the languages. This chapter is designd to quickly get you up to speed on the syntax that is expected in Perl. A Perl program consists of a sequence of declarations…
-
Environment
Before we start writing our Perl programs, let’s understand how to setup our Perl environment. Perl is available on a wide variety of platforms − This is more likely that your system will have perl installed on it. Just try giving the following command at the $ prompt − If you have perl installed on…
-
Introduction
Perl is a general-purpose programming language originally developed for text manipulation and now used for a wide range of tasks including system administration, web development, network programming, GUI development, and more. What is Perl? PC Magazine announced Perl as the finalist for its 1998 Technical Excellence Award in the Development Tool category. Perl Features Perl…
-
Data Output
Data export (or output) in MATLAB means to write into files. MATLAB allows you to use your data in another application that reads ASCII files. For this, MATLAB provides several data export options. You can create the following type of files − Apart from this, you can also export data to spreadsheets. There are two…
-
Data Import
Importing data in MATLAB means loading data from an external file. The importdata function allows loading various data files of different formats. It has the following five forms − Sr.No. Function & Description 1 A = importdata(filename)Loads data into array A from the file denoted by filename. 2 A = importdata(‘-pastespecial’)Loads data from the system clipboard rather than…
-
Functions
A function is a group of statements that together perform a task. In MATLAB, functions are defined in separate files. The name of the file and of the function should be the same. Functions operate on variables within their own workspace, which is also called the local workspace, separate from the workspace you access at the…
-
Strings
Creating a character string is quite simple in MATLAB. In fact, we have used it many times. For example, you type the following in the command prompt − MATLAB will execute the above statement and return the following result − MATLAB considers all variables as arrays, and strings are considered as character arrays. Let us…
-
Numbers
MATLAB supports various numeric classes that include signed and unsigned integers and single-precision and double-precision floating-point numbers. By default, MATLAB stores all numeric values as double-precision floating point numbers. You can choose to store any number or array of numbers as integers or as single-precision numbers. All numeric types support basic array operations and mathematical…
-
Colon Notation
The colon(:) is one of the most useful operator in MATLAB. It is used to create vectors, subscript arrays, and specify for iterations. If you want to create a row vector, containing integers from 1 to 10, you write − MATLAB executes the statement and returns a row vector containing the integers from 1 to 10 − If…