Skip to content
VUBuddy

MTH643 Final Term Special Handouts Lectures 8-15

Introduction to MATLAB PDF 6.2 MBUpdated 23 Oct 2026
Handout MTH643 Final Term Special Handouts Lectures 8-15 PDF 6.2 MB
vubuddy.com
Type
Handout
Course
MTH643 Introduction to MATLAB
Size
PDF 6.2 MB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 6.2 MB

You get 3 free files a day on the website. Add the Chrome extension for 30 a day.

Unlimited downloads in the Android app Get it free on Google Play

Preview text

Text from pages 4, 5, 6 of 79. Download the file for all 79 pages.

Generating matrices as a list of its elements. The following basis conventions

have to be taken into account:

The elements of a row are separated by commas or spaces.

A semi-colon indicates the end of each row.

The entire list of elements has to be surrounded by brackets [ ].

Row Vector

Row vector variables can be created in several ways.

The simplest method is to put the values that you want in the variable in

square brackets, separated by either spaces or commas.

For instance, a row vector with four elements in MATLAB can be

generated as:

rowvec=[2,4,5,6]

The required output is as under

rowvec =

Row vector using Colon Operator

Row vector can also be generated using Colon operator(;)

The entries in the generated Row vector iterates from the starting to the

ending value with a default step of one.

In this case the square brackets are not necessary.

For example, a row vector having 2, 3, 4, 5, 6 entries can be generated as

» colvec=2:6

The necessary output is

colvec =

Colon Operator with Step value

Row vector with Colon operator can also be generated by defining step

value for each entry of the matrix.

For example, the row vector with entries 2, 4, 6, 8, 10 can be generated as

» stepvec = 2:2:10

The desired output is

stepvec = Row vector is generated in different ways

J1 MATLAB 7.10.0

File Edit Debug Parallel Desktop Window Help

'CJ e3 I d!i - llll! "') (II I A I · ~ I Current Folder: \\lro-lnomes-01 \ usersS\ imrantalib\ My Documents\ MATLAB

Shortcuts [fJ How to Add [fJ What's New

'" Cl X ®' EditorY:\ Siides MatlabVU\ Script files\ Matrix algebra.m

.=."-f.= ljl:::== « =MA=TLA = B=====.=rl =P -;=-1 o-"""'. ; 'CJ €3 • I dG 'IJ (II I 'fi1 ·1141 + • fo I • €J t'J 41 .. If ll &I Stack:! Base ·II fx Cl ll X f I Workspace Cl ll X ,

HJ [I] E3 iSl [QJ x . 1

I

D +liD I - I + El X 1 %~ Na·me • Val Name • Gl

colvec [2,3 ;: -4: J T aylororder2.m x J. Picardmethod.m x j_ coefvec.m x J picardinputfunc.m xI weight.m x J. funvec.m x l_ adobetest.m x [( Matrix algebra.m rowvec [2,4 3 stepvec [2,4

>> rowvec = (2,4,5,6)

r owvec =

>> col vec=2: 6

col vee =

I • I Ill I

Command ... ... Cl

X

!···c l ear a A

>> stepvec = 2 : 2: 10 L..c l ear a ll

e ·%-- 11/ 21/ 16 1(

stepvec = L.. c l c

6 't-- 11/ 22/lG 1<

1.0 ; ··c l c

fx. I ··rowvec = (2,

; ··c l c

··t4atri x a lqeb

; ··c l c

··rowvec = (2,

; ··col vec=2: 6

I i ··stepvec = 2 : .

>etails • I Ill I

Figure: Display of the Row vector in different ways

Column Vector

There are two basic methods for creating Column vector:

Either by putting the values in square brackets, separated by semicolons.

or by creating a row vector and then transposing it.

The transpose operator in MATLAB is the apostrophe.

All MTH643 files →
MTH643 Introduction to MATLAB All MTH643 handouts, past papers, quizzes and MCQs in one place. Open course page

Get more out of VUBuddy, for free

Android app Free on Google Play
  • Unlimited downloads
  • The explanation behind every MCQ answer
  • Study offline on slow data
Get the Android app
Chrome extension Free on the Chrome Web Store
  • 30 downloads a day instead of 3
  • Sign in and buy Pro Semester here
Add to Chrome

One Pro Semester membership works in both the extension and the app.