100% found this document useful (1 vote)
37 views2 pages

Assignment

The document outlines an assignment for an Advanced Programming course in the Department of Mathematics. It consists of several tasks requiring the creation of MatLab programs using loops and conditional statements to manipulate matrices and perform calculations. Specific tasks include creating matrices with defined properties, replacing rows, and calculating sums and products.

Uploaded by

chenardanar89
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
100% found this document useful (1 vote)
37 views2 pages

Assignment

The document outlines an assignment for an Advanced Programming course in the Department of Mathematics. It consists of several tasks requiring the creation of MatLab programs using loops and conditional statements to manipulate matrices and perform calculations. Specific tasks include creating matrices with defined properties, replacing rows, and calculating sums and products.

Uploaded by

chenardanar89
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/ 2

Department of Mathematics

Second Stage
Advanced Programming
Assignment #1

1. Write a MatLab program (use for loop and if…else) to create a 4 × 4 matrix
such that the upper elements of the main diagonal all are 4 , the lower
elements of the diagonal are 2 and the elements of the main diagonal are 1.

2. Write a MatLab program (use for loop and if…else) to create a 5 × 5 matrix
such that the elements of both main diagonal and the second diagonal are 0
and other elements are 1.

3. By using function, for loop, and if, write a MatLab program to replace row
one by row three in a 3 × 3 matrix.

4. Write a MatLab program to calculate the following


10
(i + j2 )
5
∑∑
j=1 i
i=1

5. Write a MatLab program to calculate the following


5 5

∏∑i ∗ j
i=1 j=1

6. By using function and for loop write a MatLab program to give the
following output
Department of Mathematics
Second Stage
Advanced Programming
Assignment #1

7. Write a MatLab program to give the following output.(use for loop)

8. Write a MatLab program to give the following output.(use for loop)

You might also like