SlideShare a Scribd company logo
Assignment # 3 
Fall 2015 
Course title: STRUCTURED COMPUTER PROGRAMMING Course #: EE201 
Sections: All 
Name: Student #: 
Q1) Use MATLAB to do the following: 
i) Create a vector M with exactly 25 values evenly distributed between -3 and 5 
_ 
ii) Add 0.23 to all the odd-indexed elements of the vector M and assign the result to N 
_ 
iii) Create a vector V of only the even numbers between 32 and 75. (i.e.: 32 34 36 … 72 74) 
_ 
iv) Find the total number of elements in vector V 
_ 
v) Find the 7th element of the vector V 
_ M=linspace(-3,5,25) 
M(1:2:end)+0.23 
V=32:2:74 
length(v) 
M(7) 
1324593 khaled mohammed al-awlaqi
EE201 – Lab Assignment 3 Fall 2015 
Page 2 of 3 
Q2) Create a Matrix A with the following numbers: 퐴=[ 1068−37−22−4319−45632] 
_____________________________________________________________________ 
i) Extract out the 3rd row of matrix A as a vector and assign this to a vector m using array addressing 
퐴=[ 1068−37−22−4319−45632] 
_____________________________________________________________________ 
ii) Transpose matrix A and store the result in matrix B 
_____________________________________________________________________ 
iii) Replace the 3rd column of matrix A with 2nd row of matrix B using array addressing 
_____________________________________________________________________ 
iv) Delete the 3rd column of matrix B 
_____________________________________________________________________ 
v) Create a 2×3 matrix D consisting of all elements in the first two rows and the last three columns of matrix A using array addressing 
[ 1068−36−2−3−4319−416−42] 
_____________________________________________________________________ 
vi) Find the maximum values in each column of matrix A 
_____________________________________________________________________ 
>> b=a' b = 10 8 3 9 , 6 -3 1 -4 ,7 2 5 3, 2 -4 6 2 
A(3,:) 3 1 5 6 
A'(3,:) b = 10 8 3 9, 6 -3 1 -4, 7 2 5 3, 2 -4 6 2 
A(:,3)=A(2,:) 
d=b(:,3) 
D=a(1,2,2,4) 
max(a)
EE201 – Lab Assignment 3 Fall 2015 
Page 3 of 3 
vii) Find the minimum values in each row of matrix A 
_____________________________________________________________________ 
viii) Sort each row of matrix A in descending order and store the result in Y 
_____________________________________________________________________ 
ix) Find the sum of the third column of matrix Y 
_____________________________________________________________________ 
Q3) Let a = [3 2 6 8] and b = [4 1 3 5]. Find the following: 
i) x = a × b 
_____________________________________________________________________ 
ii) 푦= √푎+Σ푏푎 
_____________________________________________________________________ 
iii) 푧=0,13⁄,25⁄,37⁄,…푢푝 푡표 715⁄ 
_____________________________________________________________________ 
iv) 푛= −1푖+1sin(2푖) 푖2−1 푤ℎ푒푟푒 푖 푖푠 푎 푣푒푐푡표푟 푓푟표푚 0° 푢푝푡표 90° 
_____________________________________________________________________ >> min(a,[],2 ) ans = 3 -4 2 
y=sort(a) y=3 -4 2 -4 8 -3 3 2 9 15 2 10 6 7 6 
sum a(:,3) 
a.*b 
y=sqrt([3 2 6 8 ])+sum(b.^[3 2 6 8 ]) 
z=[0:7]/15 
n=(-1.^([0:90]+1).*sin(2.*[0:90]))/(([0:90].^2)-1)

More Related Content

PPT
Lesson5.1 complexnumbers demo
DOCX
Examen du seconde semestre g8
PPTX
5.4 Complex Numbers
PPT
Matrices Chapter 4 Obj. 1.04,2.10
PDF
BUSINESS STATISTICS IMPORTANT QUESTIONS LIST
PDF
Mcqs -Matrices and determinants
PDF
Pc 6.3 notes_vectors
PDF
EE201_Assignment4
Lesson5.1 complexnumbers demo
Examen du seconde semestre g8
5.4 Complex Numbers
Matrices Chapter 4 Obj. 1.04,2.10
BUSINESS STATISTICS IMPORTANT QUESTIONS LIST
Mcqs -Matrices and determinants
Pc 6.3 notes_vectors
EE201_Assignment4

What's hot (20)

DOCX
First semester 1
PPTX
Section 4 2 math
PDF
A study on solving Assignment Problem
PPT
Core 3 Modulus 1
PDF
ikh323-06
DOCX
A1 1 linear fxns notes
DOCX
A2. u1. calculo diferencial. unadm
PDF
4.7solvinggraphing
PDF
7th pre alg -l9
PDF
8th pre alg -l9
DOCX
Final exam 2016 g7
PDF
Mathematica model test paper
DOCX
Linear Programming Project
PDF
Assignment 1 b
PDF
PC 10.6 notes Parametric
DOC
2period review (1)
PDF
Assignment 1
PPTX
6.4 inverse matrices t
PPTX
1.1 and 1.2 slides revised
First semester 1
Section 4 2 math
A study on solving Assignment Problem
Core 3 Modulus 1
ikh323-06
A1 1 linear fxns notes
A2. u1. calculo diferencial. unadm
4.7solvinggraphing
7th pre alg -l9
8th pre alg -l9
Final exam 2016 g7
Mathematica model test paper
Linear Programming Project
Assignment 1 b
PC 10.6 notes Parametric
2period review (1)
Assignment 1
6.4 inverse matrices t
1.1 and 1.2 slides revised
Ad

Viewers also liked (20)

PDF
Assignment1
PDF
02 atiqa ijaz khan 01
PDF
02 atiqa ijaz khan 03
PDF
02 atiqa ijaz khan 02
PDF
Applied statistics and probability for engineers solution montgomery && runger
PPTX
Benefits of vitamin C
PPT
Budaya politik
PPTX
"Parla con Noi" - Realizzazione di un format televisivo
PPTX
SalesUP - Akılcı Yönetim Araçları - Araştırma
PDF
Untitled Presentation
PPTX
PPTX
Μακαρόνια με καλαμαράκια
PPTX
RX for the Modern Website: How Your Digital Presence Can Drive Demand
PDF
Flippa klassrummet, Föreläsning Sundbybergs IKT-inspirationsdag, 28/10-14
DOCX
Timeline of the American Colonies and Britain from c.1774 to 1776
DOC
Mohamed gamal. cv
PPTX
Prezentaciya vchitelya matematiki_chervonec_inni_oleksandrivni
PPT
Perangkat keras komputer
PDF
Puzzle perf im_partie_1
PPTX
Contents page
Assignment1
02 atiqa ijaz khan 01
02 atiqa ijaz khan 03
02 atiqa ijaz khan 02
Applied statistics and probability for engineers solution montgomery && runger
Benefits of vitamin C
Budaya politik
"Parla con Noi" - Realizzazione di un format televisivo
SalesUP - Akılcı Yönetim Araçları - Araştırma
Untitled Presentation
Μακαρόνια με καλαμαράκια
RX for the Modern Website: How Your Digital Presence Can Drive Demand
Flippa klassrummet, Föreläsning Sundbybergs IKT-inspirationsdag, 28/10-14
Timeline of the American Colonies and Britain from c.1774 to 1776
Mohamed gamal. cv
Prezentaciya vchitelya matematiki_chervonec_inni_oleksandrivni
Perangkat keras komputer
Puzzle perf im_partie_1
Contents page
Ad

Similar to EE201_Assignment3 (20)

PPS
PDF
Matlab cheatsheet
PDF
Introduction to matlab chapter2 by Dr.Bashir m. sa'ad.pdf
PPTX
An Introduction to MATLAB for beginners
PPTX
MATLAB - Arrays and Matrices
PDF
Matlab booklet
PPTX
Matlab ch1 (3)
PPTX
Introduction to Matlab and application.pptx
PDF
Assignment On Matlab
PPTX
Linear Algebra.pptx
PDF
Matlab/R Dictionary
DOCX
MATLAB sessions Laboratory 2MAT 275 Laboratory 2Matrix .docx
PDF
PDF
Matlab practice
PDF
Travaux Pratique Matlab + Corrige_Smee Kaem Chann
PDF
Solution of matlab chapter 2
PDF
PDF
Matrices, Arrays and Vectors in MATLAB
PDF
Matlab Intro to Arrays Guide for Beginners.pdf
PPTX
Introduction to matlab lecture 2 of 4
Matlab cheatsheet
Introduction to matlab chapter2 by Dr.Bashir m. sa'ad.pdf
An Introduction to MATLAB for beginners
MATLAB - Arrays and Matrices
Matlab booklet
Matlab ch1 (3)
Introduction to Matlab and application.pptx
Assignment On Matlab
Linear Algebra.pptx
Matlab/R Dictionary
MATLAB sessions Laboratory 2MAT 275 Laboratory 2Matrix .docx
Matlab practice
Travaux Pratique Matlab + Corrige_Smee Kaem Chann
Solution of matlab chapter 2
Matrices, Arrays and Vectors in MATLAB
Matlab Intro to Arrays Guide for Beginners.pdf
Introduction to matlab lecture 2 of 4

Recently uploaded (20)

PDF
1 - Historical Antecedents, Social Consideration.pdf
PPT
What is a Computer? Input Devices /output devices
PDF
Getting started with AI Agents and Multi-Agent Systems
PDF
A review of recent deep learning applications in wood surface defect identifi...
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PDF
CloudStack 4.21: First Look Webinar slides
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PDF
A comparative study of natural language inference in Swahili using monolingua...
PPTX
Web Crawler for Trend Tracking Gen Z Insights.pptx
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PDF
STKI Israel Market Study 2025 version august
PDF
Hindi spoken digit analysis for native and non-native speakers
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
Getting Started with Data Integration: FME Form 101
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
1 - Historical Antecedents, Social Consideration.pdf
What is a Computer? Input Devices /output devices
Getting started with AI Agents and Multi-Agent Systems
A review of recent deep learning applications in wood surface defect identifi...
Final SEM Unit 1 for mit wpu at pune .pptx
CloudStack 4.21: First Look Webinar slides
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
A comparative study of natural language inference in Swahili using monolingua...
Web Crawler for Trend Tracking Gen Z Insights.pptx
Enhancing emotion recognition model for a student engagement use case through...
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Taming the Chaos: How to Turn Unstructured Data into Decisions
STKI Israel Market Study 2025 version august
Hindi spoken digit analysis for native and non-native speakers
O2C Customer Invoices to Receipt V15A.pptx
Zenith AI: Advanced Artificial Intelligence
Getting Started with Data Integration: FME Form 101
Group 1 Presentation -Planning and Decision Making .pptx
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Univ-Connecticut-ChatGPT-Presentaion.pdf

EE201_Assignment3

  • 1. Assignment # 3 Fall 2015 Course title: STRUCTURED COMPUTER PROGRAMMING Course #: EE201 Sections: All Name: Student #: Q1) Use MATLAB to do the following: i) Create a vector M with exactly 25 values evenly distributed between -3 and 5 _ ii) Add 0.23 to all the odd-indexed elements of the vector M and assign the result to N _ iii) Create a vector V of only the even numbers between 32 and 75. (i.e.: 32 34 36 … 72 74) _ iv) Find the total number of elements in vector V _ v) Find the 7th element of the vector V _ M=linspace(-3,5,25) M(1:2:end)+0.23 V=32:2:74 length(v) M(7) 1324593 khaled mohammed al-awlaqi
  • 2. EE201 – Lab Assignment 3 Fall 2015 Page 2 of 3 Q2) Create a Matrix A with the following numbers: 퐴=[ 1068−37−22−4319−45632] _____________________________________________________________________ i) Extract out the 3rd row of matrix A as a vector and assign this to a vector m using array addressing 퐴=[ 1068−37−22−4319−45632] _____________________________________________________________________ ii) Transpose matrix A and store the result in matrix B _____________________________________________________________________ iii) Replace the 3rd column of matrix A with 2nd row of matrix B using array addressing _____________________________________________________________________ iv) Delete the 3rd column of matrix B _____________________________________________________________________ v) Create a 2×3 matrix D consisting of all elements in the first two rows and the last three columns of matrix A using array addressing [ 1068−36−2−3−4319−416−42] _____________________________________________________________________ vi) Find the maximum values in each column of matrix A _____________________________________________________________________ >> b=a' b = 10 8 3 9 , 6 -3 1 -4 ,7 2 5 3, 2 -4 6 2 A(3,:) 3 1 5 6 A'(3,:) b = 10 8 3 9, 6 -3 1 -4, 7 2 5 3, 2 -4 6 2 A(:,3)=A(2,:) d=b(:,3) D=a(1,2,2,4) max(a)
  • 3. EE201 – Lab Assignment 3 Fall 2015 Page 3 of 3 vii) Find the minimum values in each row of matrix A _____________________________________________________________________ viii) Sort each row of matrix A in descending order and store the result in Y _____________________________________________________________________ ix) Find the sum of the third column of matrix Y _____________________________________________________________________ Q3) Let a = [3 2 6 8] and b = [4 1 3 5]. Find the following: i) x = a × b _____________________________________________________________________ ii) 푦= √푎+Σ푏푎 _____________________________________________________________________ iii) 푧=0,13⁄,25⁄,37⁄,…푢푝 푡표 715⁄ _____________________________________________________________________ iv) 푛= −1푖+1sin(2푖) 푖2−1 푤ℎ푒푟푒 푖 푖푠 푎 푣푒푐푡표푟 푓푟표푚 0° 푢푝푡표 90° _____________________________________________________________________ >> min(a,[],2 ) ans = 3 -4 2 y=sort(a) y=3 -4 2 -4 8 -3 3 2 9 15 2 10 6 7 6 sum a(:,3) a.*b y=sqrt([3 2 6 8 ])+sum(b.^[3 2 6 8 ]) z=[0:7]/15 n=(-1.^([0:90]+1).*sin(2.*[0:90]))/(([0:90].^2)-1)