- Type
- Quiz
- Course
- MTH643 Introduction to MATLAB
- Size
- PDF 379 KB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extension for 30 a day.
Preview text
Text from pages 1, 2, 3 of 16. Download the file for all 16 pages.
Solved by M L!K HAFEEZ
MTH643 current papers
Q1. Find the numerical solution of the following equation using ode45 command and plot the curve on [0 2].
y’(x)=y-x2+1 , y(0)=0.5
Solution
clc clear all close all
xspan=[0,2]; y0=0.5;
plot(x,y)
Q2. Find the numerical solution of the following equation using ode45 command and plot the curve on [0 2].
y’(x)=y-x2+1 , y(0)=0.5;0.3;3
Solution
clc clear all close all
xspan=[0,2]; y0=0.5:0.3:3;
plot(x,y)
Q3. Find the numerical solution of the following equation using ode45 command and plot the curve on x=0:0.2:2
y’(x)=y-x2+1 , y(0)=0.5
Solution
clc clear all close all
xspan=[0:0.2:2]; y0=0.5;
plot(x,y)
Q4. Write a for loop to add first 20 numbers which are divisible by 5.
Solution
clc clear all close all sum=0; for k=5:5:100; sum=sum+k; end disp(sum)
Q5. Write a program which takes a value from user and then using for loop display all of its divisors.
Solution
clc clear all close all
i=x; for j=1:i; if mod(x,j)==0 disp(j) end end
Q6. Numerically approximate the solution of the following ode dy/dt=2t use time interval [0 5] and initial condition is y(0)=0 by using ode45 command.
Solution
clc clear all close all
tspan=[0 5]; y0=0; [t y]=ode45(f,tspan,y0) plot(t,y)
Q7. Write a function with name ‘myfunction’ which takes any two number as input and returns the greater number.
Solution
function [x,y]=myfunction(n1,n2) if n1>n2 fprintf(' The max number is n1') else fprintf(' The max number is n2') end
Related MTH643 files
All MTH643 files →- MTH643 Midterm Special Handouts Lectures 1-8 Handout PDF 12.1 MB
- MTH643 Midterm Current Paper July 2022 Midterm PDF 982 KB
- MTH643 Current Paper Quiz PDF 500 KB
- MTH643 Practice Questions Lectures 1-7 Quiz PDF 2.3 MB
- MTH643 Current Paper Questions Set 2 Quiz PDF 125 KB
- MTH643 Paper Code Solution Quiz PDF 157 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.