SlideShare a Scribd company logo
Minia University
Third Year

Faculty of Engineering
Programming Lang.

CSE Department

First Exam.,3rd April, 2012

Time allowed: 2 Hrs.

Degree: 25

Attempt the following questions and assume any missing data
Question (I):Determine the size and contents of the following arrays. Note
that thelater arrays may depend on the definitions of arrays defined earlier
inthis exercise.
(a) a = 2:3:8;
(b) b = [a' a' a'];
(c) c = b(1:2:3,1:2:3);
(d) d = a + b(2,:);
(e) w = [zeros(1,3) ones(3,1)' 3:5'];
(f )b([1 3],2) = b([3 1],2);
(g) e = 1:-1:5;
Question (III)Write a MATLAB program to evaluate a function f(x, y) for any two
user-specifiedvalues x and y. The function f (x, y) is defined as follows:

Question(III): Evaluate the output of the following MATLAB segment,
% question 3, exam #1 April,2012
for ii = 1 : 2 : 4
a = 0;
forjj = 1 : ii
ifjj == 3
a = ii*jj;
elseifjj == 2
a = ii^2;
continue
else
a = jj^3;
end
fprintf('ii = %d, jj = %d and a =
end
end

%dn',ii,jj,a)

More Related Content

PDF
EC202 SIGNALS & SYSTEMS PREVIOUS QUESTION PAPER
PDF
PPTX
1.1 and 1.2 slides revised
PDF
Lecture 5 Relationship between pixel-2
PPTX
January 9, 2015 intro to functions
PPTX
Lecture one
PPTX
Lecture three
EC202 SIGNALS & SYSTEMS PREVIOUS QUESTION PAPER
1.1 and 1.2 slides revised
Lecture 5 Relationship between pixel-2
January 9, 2015 intro to functions
Lecture one
Lecture three

What's hot (20)

PPTX
Lecture two
PDF
Doc 20180130-wa0006
PPT
유한요소법(FEM)을 이용한 구조해석
PDF
VTU CBCS E&C 5th sem Information theory and coding(15EC54) Module -4 notes
PDF
VTU E&C,TCE CBCS[NEW] 5th Sem Information Theory and Coding Module-4 notes(15...
PDF
VTU E&C,TCE CBCS[NEW] 5th Sem Information Theory and Coding Module-5 notes(15...
PDF
VTU CBCS E&C 5th sem Information theory and coding(15EC54) Module -5 notes
PPT
Math unit29 using graphs to solve equations
PPT
Math unit30 functions
PDF
Assignment 1
PPT
PPTX
Two Dimentional Array
PPTX
Directed Acyclic Graph Representation of basic blocks
PPT
First Partial Review
PPT
Matrix Multiplication(An example of concurrent programming)
DOCX
Assignment premier academic writing agency with industry
PDF
Fuzzy Sequencing Problem Using Generalized Triangular Fuzzy Numbers
PPT
Parallel algorithms
PDF
Machine Learning Basics
PDF
Gate-Cs 1995
Lecture two
Doc 20180130-wa0006
유한요소법(FEM)을 이용한 구조해석
VTU CBCS E&C 5th sem Information theory and coding(15EC54) Module -4 notes
VTU E&C,TCE CBCS[NEW] 5th Sem Information Theory and Coding Module-4 notes(15...
VTU E&C,TCE CBCS[NEW] 5th Sem Information Theory and Coding Module-5 notes(15...
VTU CBCS E&C 5th sem Information theory and coding(15EC54) Module -5 notes
Math unit29 using graphs to solve equations
Math unit30 functions
Assignment 1
Two Dimentional Array
Directed Acyclic Graph Representation of basic blocks
First Partial Review
Matrix Multiplication(An example of concurrent programming)
Assignment premier academic writing agency with industry
Fuzzy Sequencing Problem Using Generalized Triangular Fuzzy Numbers
Parallel algorithms
Machine Learning Basics
Gate-Cs 1995
Ad

Similar to Exam matlab1 (20)

DOCX
2nd mid term daa paper
PPTX
lecture 2.2.2 2D array.pptx IUGLFHLHFJFY
PDF
09 a1ec01 c programming and data structures
DOC
Sp 1418794917
PDF
selfstudys_com_file (4).pdfjsjdcjjsjxjdnxjj
PDF
CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21
PDF
Aerospace Engineering (AE) - Gate Previous Question Paper 2011 Download
PDF
CS Sample Paper 1
 
PDF
D E S I G N A N D A N A L Y S I S O F A L G O R I T H M S J N T U M O D E L...
PDF
R05010303 C O M P U T E R P R O G R A M M I N G A N D N U M E R I C A L M E ...
PDF
Computer Science Sample Paper 2
 
PDF
Gate-Cs 1994
PDF
MATLAB Questions and Answers.pdf
DOC
Mca 104
PDF
ComputerScience-SQP.pdffhtu h kya hua hai ap ka school
PDF
Mathematica model test paper
PDF
Computer science ms
PDF
matlab example
PDF
Math paper class 12 maths paper class 12
PDF
Gate-Cs 2006
2nd mid term daa paper
lecture 2.2.2 2D array.pptx IUGLFHLHFJFY
09 a1ec01 c programming and data structures
Sp 1418794917
selfstudys_com_file (4).pdfjsjdcjjsjxjdnxjj
CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21
Aerospace Engineering (AE) - Gate Previous Question Paper 2011 Download
CS Sample Paper 1
 
D E S I G N A N D A N A L Y S I S O F A L G O R I T H M S J N T U M O D E L...
R05010303 C O M P U T E R P R O G R A M M I N G A N D N U M E R I C A L M E ...
Computer Science Sample Paper 2
 
Gate-Cs 1994
MATLAB Questions and Answers.pdf
Mca 104
ComputerScience-SQP.pdffhtu h kya hua hai ap ka school
Mathematica model test paper
Computer science ms
matlab example
Math paper class 12 maths paper class 12
Gate-Cs 2006
Ad

Exam matlab1

  • 1. Minia University Third Year Faculty of Engineering Programming Lang. CSE Department First Exam.,3rd April, 2012 Time allowed: 2 Hrs. Degree: 25 Attempt the following questions and assume any missing data Question (I):Determine the size and contents of the following arrays. Note that thelater arrays may depend on the definitions of arrays defined earlier inthis exercise. (a) a = 2:3:8; (b) b = [a' a' a']; (c) c = b(1:2:3,1:2:3); (d) d = a + b(2,:); (e) w = [zeros(1,3) ones(3,1)' 3:5']; (f )b([1 3],2) = b([3 1],2); (g) e = 1:-1:5; Question (III)Write a MATLAB program to evaluate a function f(x, y) for any two user-specifiedvalues x and y. The function f (x, y) is defined as follows: Question(III): Evaluate the output of the following MATLAB segment, % question 3, exam #1 April,2012 for ii = 1 : 2 : 4 a = 0; forjj = 1 : ii ifjj == 3 a = ii*jj; elseifjj == 2 a = ii^2; continue else a = jj^3; end fprintf('ii = %d, jj = %d and a = end end %dn',ii,jj,a)