- Type
- Quiz
- Course
- MTH643 Introduction to MATLAB
- Size
- PDF 500 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 2, 3, 4 of 5. Download the file for all 5 pages.
end end Area=h/3*(f(a)+f(b)+2*sum1+4*sum2)
Q4. simpson 3/8 rule
a=0; b=5; n=18; h=(b-a)/n; sum1=0; sum2=0; for k=1:n-1; x(k)=a+k*h; if (rem(k,3)==0);
else
end end Area=3*h/8*(f(a)+f(b)+2*sum1+3*sum2)
Q5. Trapezoidal rule
clear all close all clc
a=0; b=2; n=6; h=(b-a)/n; sum=0; for k=1:n-1; x(k)=a+k*h; y(k)=f(x(k)); sum=sum+y(k); end Area=h/2*(f(a)+f(b)+2*sum)
Q6. factorial using for loop
a=input(' Emter a number') fact=1; if a<0; fprintf(' The numbe is negative') else for i=1:a; fact=fact*i end end
Q7. factorial using while loop
clear all clc close all n=4; f=n; while n>1; n=n-1; f=f*n; end disp(f)
for n=20
clc clear all close all
a=0; b=2; n=20; h=(b-a)/n; value=0; for k=1:n; x(k)=a+k*h; value=value+f(x(k)); end R=value*h
Q9. Sum and Prod
function [ sum prod ] = examquestion( s,p ) clc clear al close all s=input('s') p=input('p') sum=s+p prod=s*p end
Q10. Ode45 command
clc clear all close all
tspan=[0 5]; y0=0; [t,y]=ode45(yprime,tspan,y0)
Q11. Solve differential equation by dsolve command
clc clear all close all syms y(t) ode=diff(y,t)+5*y==12; cond=y(0)==10; solve=dsolve(ode,cond)
Q12. Solve differential equation when two condition given by
dsolve command.
clc clear all close all syms y(t) Dy=diff(y); ode=diff(y,t,2)==cos(2*t)-y; cond1=y(0)==1; cond2=Dy(0)==1; cond=[cond1 cond2]; sol=dsolve(ode,cond)
Q13. solve system of linear equation by solve command
clc clear all close all equ1='2*x+y+z=2'; equ2='-x+y-z=3'; equ3='x+2*y+3*z=-10'; [x,y,z]=solve(equ1,equ2,equ3)
Q14. solve system of linear equation
clc clear all close all A=[2 1 1;-1 1 -1;1 2 3]; B=[2;3;-10]; C=inv(A); solve=C*B
Q15. Write argument matrix and find rref
clc clear all close all
Related MTH643 files
All MTH643 files →- MTH643 Final Term Special Handouts Lectures 8-15 Handout PDF 6.2 MB
- MTH643 Midterm Past Papers Set 2 Midterm PDF 161 KB
- MTH643 Quiz by AB Quiz PDF 736 KB
- MTH643 Current Papers Solution Quiz PDF 379 KB
- MTH643 Grand Assignment Assignment PDF 619 KB
- MTH643 Solved Questions Lectures 9-15 Set 2 Quiz PDF 718 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.