- Type
- Midterm past paper
- Course
- MTH643 Introduction to MATLAB
- Size
- PDF 499 KB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extensionSign in with the extension for 30 a day.
Preview text
Text from pages 1, 2, 3 of 4. Download the file for all 4 pages.
Q1. i.
Define x and initialize it with a value 15
ii.
Take the square root of x and store the answer in variable y
iii.
Write a code for expression w=x
sin( )
y
Solution:
>> clc >> clear all >> close all >> syms x >> x=15 >> y=sqrt(x) >> w=x^y*sin(pi)
Q2. Write the following in matlab
Z= x y
x y
then solve the expression to find the value of Z by
substituting the value of x=6, y=7
Solution:
>> clc >> clear all >> close all >> syms x y >> z=(x+y)^6/(x^2*y); >> subs(z,{x,y},{6,7})
Q3. Plot the contour F(x,y)=sin(x)+cos(y) over the interval of 5
Solution: >> clc >> clear all >> close all
>> contour(x,y,sin(x)+cos(y))
Q4. Base and height given find the Area?
Solution:
As we know formula of Area of rectangle is A= b×h
>> clc >> clear all >> close all >> b=4 >> h=7 >> A=1/2*b*h; >> disp(A)
Paper 2
Q1. Find the value of the following expression
i.
3 at x=5 U x y x x y y
ii.
f(x) = sin*x at x=pi/2
Solution:
I. >> clc >> clear all >> close all >> syms x y >> u=2*x+x*y^2+3*y; >> subs(u,x,5)
II. >> clc >> clear all >> close all >> syms x >> f=sin(x); >> subs(f,x,sym('pi/2'))
Q2. Find the solution of the following system of linear equations in matlab (value of x, y and z should be
Solution: clc clear all close all
[x,y,z]=solve('x+y+z==2','-x+y-z==3','x+2*y+3*z==-10')
Q3. Plot the curve of the following in one graph
f x x x x x
2 on domain [-10,10] g x x x x
Solution:
>> clc >> clear all >> close all >> syms x >> f=2*x^4+3*x^3+5*x^2+2*x-3 >> g=5*x^4+2*x^2+2*x-2 >> ezplot('f',[-10,10]) >> hold on >> ezplot('g',[-10,10]) >> hold off
Q4. Take input from user
I.
What is your name?
II.
What is your age?
Then display your name and your age is
Solution: >> clc >> clear all >> close all >> name=input('enter the name: ','s') >> age=input('enter the age: ') >> if age>20 >> disp('my age is 25') >> else age<20 >> disp('my age is not 25') >> end
Paper 3
Q1. Plot the curve of the following function
x y xy
Solution: >> clc
Related MTH643 files
All MTH643 files →- MTH643 Midterm Current Paper July 2022 Midterm PDF 982 KB
- MTH643 Midterm Practice Question 2 Midterm PDF 88 KB
- MTH643 Midterm Past Papers Set 3 Midterm PDF 150 KB
- MTH643 Midterm Past Papers Set 2 Midterm PDF 161 KB
- MTH643 Final Term Special Handouts Lectures 8-15 Handout PDF 6.2 MB
- MTH643 Current Paper Questions Quiz PDF 227 KB
Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.