[go: up one dir, main page]

0% found this document useful (0 votes)
10 views3 pages

CHE261 Tutorial2

This document provides instructions and questions for a tutorial on creating and manipulating arrays in MATLAB. Students are asked to: 1) Create various row and column vectors from given elements and expressions. This includes creating vectors from other predefined vectors by concatenating their elements. 2) Answer questions about array indexing and addressing, including retrieving specific elements, subsets of elements, and manipulating elements based on their positions in arrays. 3) Save their work in a diary, clear the workspace and command window when finished to prepare for the next activity. 4) Complete additional exercises creating and manipulating arrays, including transposing matrices and using array indexing to modify element values. The tutorial aims to teach students the basics of creating

Uploaded by

Maame Durowaa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views3 pages

CHE261 Tutorial2

This document provides instructions and questions for a tutorial on creating and manipulating arrays in MATLAB. Students are asked to: 1) Create various row and column vectors from given elements and expressions. This includes creating vectors from other predefined vectors by concatenating their elements. 2) Answer questions about array indexing and addressing, including retrieving specific elements, subsets of elements, and manipulating elements based on their positions in arrays. 3) Save their work in a diary, clear the workspace and command window when finished to prepare for the next activity. 4) Complete additional exercises creating and manipulating arrays, including transposing matrices and using array indexing to modify element values. The tutorial aims to teach students the basics of creating

Uploaded by

Maame Durowaa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

KWAME NKRUMAH UNIVERSITY OF SCIENCE AND TECHNOLOGY

COLLEGE OF ENGINEERING
DEPARTMENT OF CHEMICAL ENGINEERING
COMPUTER APPLICATIONS FOR ENGINEERS (CHE 261)
Tutorial 2: Array creation and address
Activity 1
Switch on your diary
Activity 2
Question 1
1.a Create a variable a that is a row vector with the following elements: 9, 1, 32,
7/4, 0, 2.25 × 8.5, 0.8, and 𝑠𝑖𝑛(𝜋/8) .
1.b Create a vairable c that is a column vector with the following elements:
2.1 × 10−2 , 𝑠𝑖𝑛(1.7𝜋), 28.5, 2.74/3 , 𝑎𝑛𝑑 𝑒 3 .
1.c Define the variables d=4,5 and e=2.8, and then use them to create the colunm vector
(assign to variable named f) that has the following elements:
𝑒 2 , 𝑑, (𝑑 + 𝑒), 𝑑𝑒 , 𝑎𝑛𝑑 𝑒.
1.d Create a variable g that is a row vector in which the first element is 3 and the
last element is 27, with an increment of 4 between the elements.
1.e Create two row vectors v=41:-3:29 and w=17:4:37. Then, by only using the name of the
vectors (v and w), create a row vector u that is made from the elements of w followed by the
elements of v.
1.f Create two column vectors T=[5:5:25]’ and S=[27:2:33]’. Then, by only using the name
of the vectors (T and S), create a column vector R that is made from the elements of T
followed by the elements of S.
Question 2
i.

ii.

iii.

iv.
Activity 3
Turn off your dairy
Clear your workspace
Clear the command window

Activity 4
Question 1

Question 2

You might also like