Skip to content
VUBuddy

MTH643 Current Papers Solution

Introduction to MATLAB PDF 379 KBUpdated 23 Oct 2026
Quiz MTH643 Current Papers Solution PDF 379 KB
vubuddy.com
Type
Quiz
Course
MTH643 Introduction to MATLAB
Size
PDF 379 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 379 KB

You get 3 free files a day on the website. Add the Chrome extension for 30 a day.

Unlimited downloads in the Android app Get it free on Google Play

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

All MTH643 files →
MTH643 Introduction to MATLAB All MTH643 handouts, past papers, quizzes and MCQs in one place. Open course page

Get more out of VUBuddy, for free

Android app Free on Google Play
  • Unlimited downloads
  • The explanation behind every MCQ answer
  • Study offline on slow data
Get the Android app
Chrome extension Free on the Chrome Web Store
  • 30 downloads a day instead of 3
  • Sign in and buy Pro Semester here
Add to Chrome

One Pro Semester membership works in both the extension and the app.