SlideShare a Scribd company logo
1 of 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)

More Related Content

What's hot

유한요소법(FEM)을 이용한 구조해석
유한요소법(FEM)을 이용한 구조해석유한요소법(FEM)을 이용한 구조해석
유한요소법(FEM)을 이용한 구조해석chimco.net
 
VTU CBCS E&C 5th sem Information theory and coding(15EC54) Module -4 notes
VTU CBCS E&C 5th sem Information theory and coding(15EC54) Module -4 notesVTU CBCS E&C 5th sem Information theory and coding(15EC54) Module -4 notes
VTU CBCS E&C 5th sem Information theory and coding(15EC54) Module -4 notesJayanth Dwijesh H P
 
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-4 notes(15...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-4 notes(15...Jayanth Dwijesh H P
 
VTU E&C,TCE CBCS[NEW] 5th Sem Information Theory and Coding Module-5 notes(15...
VTU E&C,TCE CBCS[NEW] 5th Sem Information Theory and Coding Module-5 notes(15...VTU E&C,TCE CBCS[NEW] 5th Sem Information Theory and Coding Module-5 notes(15...
VTU E&C,TCE CBCS[NEW] 5th Sem Information Theory and Coding Module-5 notes(15...Jayanth Dwijesh H P
 
VTU CBCS E&C 5th sem Information theory and coding(15EC54) Module -5 notes
VTU CBCS E&C 5th sem Information theory and coding(15EC54) Module -5 notesVTU CBCS E&C 5th sem Information theory and coding(15EC54) Module -5 notes
VTU CBCS E&C 5th sem Information theory and coding(15EC54) Module -5 notesJayanth Dwijesh H P
 
Math unit29 using graphs to solve equations
Math unit29 using graphs to solve equationsMath unit29 using graphs to solve equations
Math unit29 using graphs to solve equationseLearningJa
 
Math unit30 functions
Math unit30 functionsMath unit30 functions
Math unit30 functionseLearningJa
 
Directed Acyclic Graph Representation of basic blocks
Directed Acyclic Graph Representation of basic blocksDirected Acyclic Graph Representation of basic blocks
Directed Acyclic Graph Representation of basic blocksMohammad Vaseem Akaram
 
Matrix Multiplication(An example of concurrent programming)
Matrix Multiplication(An example of concurrent programming)Matrix Multiplication(An example of concurrent programming)
Matrix Multiplication(An example of concurrent programming)Pramit Kumar
 
Assignment premier academic writing agency with industry
Assignment premier academic writing agency with industry Assignment premier academic writing agency with industry
Assignment premier academic writing agency with industry Nicole Valerio
 
Fuzzy Sequencing Problem Using Generalized Triangular Fuzzy Numbers
Fuzzy Sequencing Problem Using Generalized Triangular Fuzzy NumbersFuzzy Sequencing Problem Using Generalized Triangular Fuzzy Numbers
Fuzzy Sequencing Problem Using Generalized Triangular Fuzzy NumbersIJERA Editor
 
Parallel algorithms
Parallel algorithmsParallel algorithms
Parallel algorithmsguest084d20
 

What's hot (20)

Lecture two
Lecture twoLecture two
Lecture two
 
Doc 20180130-wa0006
Doc 20180130-wa0006Doc 20180130-wa0006
Doc 20180130-wa0006
 
유한요소법(FEM)을 이용한 구조해석
유한요소법(FEM)을 이용한 구조해석유한요소법(FEM)을 이용한 구조해석
유한요소법(FEM)을 이용한 구조해석
 
VTU CBCS E&C 5th sem Information theory and coding(15EC54) Module -4 notes
VTU CBCS E&C 5th sem Information theory and coding(15EC54) Module -4 notesVTU CBCS E&C 5th sem Information theory and coding(15EC54) Module -4 notes
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-4 notes(15...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-4 notes(15...
 
VTU E&C,TCE CBCS[NEW] 5th Sem Information Theory and Coding Module-5 notes(15...
VTU E&C,TCE CBCS[NEW] 5th Sem Information Theory and Coding Module-5 notes(15...VTU E&C,TCE CBCS[NEW] 5th Sem Information Theory and Coding Module-5 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
VTU CBCS E&C 5th sem Information theory and coding(15EC54) Module -5 notesVTU CBCS E&C 5th sem Information theory and coding(15EC54) Module -5 notes
VTU CBCS E&C 5th sem Information theory and coding(15EC54) Module -5 notes
 
Math unit29 using graphs to solve equations
Math unit29 using graphs to solve equationsMath unit29 using graphs to solve equations
Math unit29 using graphs to solve equations
 
Math unit30 functions
Math unit30 functionsMath unit30 functions
Math unit30 functions
 
Assignment 1
Assignment 1Assignment 1
Assignment 1
 
Week7
Week7Week7
Week7
 
Two Dimentional Array
Two Dimentional ArrayTwo Dimentional Array
Two Dimentional Array
 
Directed Acyclic Graph Representation of basic blocks
Directed Acyclic Graph Representation of basic blocksDirected Acyclic Graph Representation of basic blocks
Directed Acyclic Graph Representation of basic blocks
 
First Partial Review
First Partial ReviewFirst Partial Review
First Partial Review
 
Matrix Multiplication(An example of concurrent programming)
Matrix Multiplication(An example of concurrent programming)Matrix Multiplication(An example of concurrent programming)
Matrix Multiplication(An example of concurrent programming)
 
Assignment premier academic writing agency with industry
Assignment premier academic writing agency with industry Assignment premier academic writing agency with industry
Assignment premier academic writing agency with industry
 
Fuzzy Sequencing Problem Using Generalized Triangular Fuzzy Numbers
Fuzzy Sequencing Problem Using Generalized Triangular Fuzzy NumbersFuzzy Sequencing Problem Using Generalized Triangular Fuzzy Numbers
Fuzzy Sequencing Problem Using Generalized Triangular Fuzzy Numbers
 
Parallel algorithms
Parallel algorithmsParallel algorithms
Parallel algorithms
 
Machine Learning Basics
Machine Learning BasicsMachine Learning Basics
Machine Learning Basics
 
Gate-Cs 1995
Gate-Cs 1995Gate-Cs 1995
Gate-Cs 1995
 

Similar to Exam matlab1

2nd mid term daa paper
2nd mid term daa paper2nd mid term daa paper
2nd mid term daa paperMansi Puri
 
09 a1ec01 c programming and data structures
09 a1ec01 c programming and data structures09 a1ec01 c programming and data structures
09 a1ec01 c programming and data structuresjntuworld
 
Sp 1418794917
Sp 1418794917Sp 1418794917
Sp 1418794917lakshmi r
 
CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21
CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21
CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21chinthala Vijaya Kumar
 
Aerospace Engineering (AE) - Gate Previous Question Paper 2011 Download
Aerospace Engineering (AE) - Gate Previous Question Paper 2011 DownloadAerospace Engineering (AE) - Gate Previous Question Paper 2011 Download
Aerospace Engineering (AE) - Gate Previous Question Paper 2011 DownloadRakesh Bhupathi
 
CS Sample Paper 1
CS Sample Paper 1CS Sample Paper 1
CS Sample Paper 1kvs
 
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...
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...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...
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...guest3f9c6b
 
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 ...
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 ...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 ...
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 ...guestd436758
 
Computer Science Sample Paper 2
Computer Science Sample Paper 2Computer Science Sample Paper 2
Computer Science Sample Paper 2kvs
 
MATLAB Questions and Answers.pdf
MATLAB Questions and Answers.pdfMATLAB Questions and Answers.pdf
MATLAB Questions and Answers.pdfahmed8651
 
Mathematica model test paper
Mathematica model test paperMathematica model test paper
Mathematica model test paperLuckshay Batra
 
Computer science ms
Computer science msComputer science ms
Computer science msB Bhuvanesh
 
GSP 125 Enhance teaching/tutorialrank.com
 GSP 125 Enhance teaching/tutorialrank.com GSP 125 Enhance teaching/tutorialrank.com
GSP 125 Enhance teaching/tutorialrank.comjonhson300
 
GSP 125 Effective Communication/tutorialrank.com
 GSP 125 Effective Communication/tutorialrank.com GSP 125 Effective Communication/tutorialrank.com
GSP 125 Effective Communication/tutorialrank.comjonhson282
 

Similar to Exam matlab1 (20)

2nd mid term daa paper
2nd mid term daa paper2nd mid term daa paper
2nd mid term daa paper
 
09 a1ec01 c programming and data structures
09 a1ec01 c programming and data structures09 a1ec01 c programming and data structures
09 a1ec01 c programming and data structures
 
Sp 1418794917
Sp 1418794917Sp 1418794917
Sp 1418794917
 
CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21
CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21
CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21
 
Aerospace Engineering (AE) - Gate Previous Question Paper 2011 Download
Aerospace Engineering (AE) - Gate Previous Question Paper 2011 DownloadAerospace Engineering (AE) - Gate Previous Question Paper 2011 Download
Aerospace Engineering (AE) - Gate Previous Question Paper 2011 Download
 
CS Sample Paper 1
CS Sample Paper 1CS Sample Paper 1
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...
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...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...
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 ...
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 ...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 ...
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
Computer Science Sample Paper 2Computer Science Sample Paper 2
Computer Science Sample Paper 2
 
Gate-Cs 1994
Gate-Cs 1994Gate-Cs 1994
Gate-Cs 1994
 
MATLAB Questions and Answers.pdf
MATLAB Questions and Answers.pdfMATLAB Questions and Answers.pdf
MATLAB Questions and Answers.pdf
 
Mca 104
Mca 104Mca 104
Mca 104
 
Mathematica model test paper
Mathematica model test paperMathematica model test paper
Mathematica model test paper
 
Computer science ms
Computer science msComputer science ms
Computer science ms
 
matlab example
matlab examplematlab example
matlab example
 
Gate-Cs 2006
Gate-Cs 2006Gate-Cs 2006
Gate-Cs 2006
 
GSP 125 Enhance teaching/tutorialrank.com
 GSP 125 Enhance teaching/tutorialrank.com GSP 125 Enhance teaching/tutorialrank.com
GSP 125 Enhance teaching/tutorialrank.com
 
GSP 125 Effective Communication/tutorialrank.com
 GSP 125 Effective Communication/tutorialrank.com GSP 125 Effective Communication/tutorialrank.com
GSP 125 Effective Communication/tutorialrank.com
 
Gate-Cs 1996
Gate-Cs 1996Gate-Cs 1996
Gate-Cs 1996
 
Matlab-1.pptx
Matlab-1.pptxMatlab-1.pptx
Matlab-1.pptx
 

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)