0% found this document useful (0 votes)
20 views

University of Engineering and Technology, Taxila: Lab Manual No 04 Conditional Statements and Loops in MATLAB

This document outlines a lab manual for a computer engineering course at the University of Engineering and Technology, Taxila. The lab manual covers conditional statements and loops in MATLAB and is dated from November 28, 2016 to December 2, 2016 for the autumn 2016 semester. It includes 8 tasks for students to complete, such as writing MATLAB code to find prime numbers, perform operations on random vectors, define a function to assign grades, and calculate averages using nested loops.

Uploaded by

zain ai
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)
20 views

University of Engineering and Technology, Taxila: Lab Manual No 04 Conditional Statements and Loops in MATLAB

This document outlines a lab manual for a computer engineering course at the University of Engineering and Technology, Taxila. The lab manual covers conditional statements and loops in MATLAB and is dated from November 28, 2016 to December 2, 2016 for the autumn 2016 semester. It includes 8 tasks for students to complete, such as writing MATLAB code to find prime numbers, perform operations on random vectors, define a function to assign grades, and calculate averages using nested loops.

Uploaded by

zain ai
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

UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA

FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING


COMPUTER ENGINEERING DEPARTMENT

Computer Application in Engineering Design


Lab Manual No 04
Conditional Statements and Loops in MATLAB

Dated:
28th November, 2016 to 02nd December, 2016

Semester:
Autumn 2016

Computer Application in Engineering Design


Session:-2015 Computer

Lab Instructor:-Engr. Aamir Arsalan

UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA


FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
COMPUTER ENGINEERING DEPARTMENT

Lab Tasks:1. Write a MATLAB code to find the prime numbers from 1 to
100.
2. Generate a random vector of 100 numbers ranging from 1 to
200. Write a MATLAB code to find the numbers which are
multiple of 2 and 3. Create separate vectors for multiple
of 2 and 3.
3. Write a function named assign_grade that: takes 1 argument,
a number score. returns a grade for the score, either "A",
"B", "C", "D", or "F".
4. Write a program to convert an integer number into its
equivalent binary number.
5. Write a program to find out the factorial of an integer.
6. Write a program to calculate the sum of the first 10 odd
numbers and first 10 even numbers.
7. Write a program to calculate the square and cube of first
ten even numbers.
8. Write a program to compute the average grade of each
student in a class of 20 students. Each student has taken
four exams during the semester. The final grade is
calculated as the average of these exam grades. The program
should display the average grade of the student. Use nested
loops.

Computer Application in Engineering Design


Session:-2015 Computer

Lab Instructor:-Engr. Aamir Arsalan

You might also like