- Type
- Quiz
- Course
- MTH643 Introduction to MATLAB
- Size
- PDF 157 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 4. Download the file for all 4 pages.
sum2=0; for k=1:n-1; x(k)=a+k*h; if (rem(k,3)==0);
else
end end
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 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)
Q13. 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
Q14. Write argument matrix and find rref
clc clear all close all A=[8 1 6;3 5 7;4 9 2] b=[1;1;1] Ab=[A b] solve=rref(Ab)
Q15. Matrix multiplication
clc clear all close all A=sym([3/11 2/5 4/7;2/3 4/5 6/7;7/9 8/6 9/4]) B=sym([1/3 8/9 4;2/9 3/7 9/6;6 7/4 5/7]) mult=A*B iver=inv(A)
Related MTH643 files
All MTH643 files →- MTH643 Final Term Special Handouts Lectures 8-15 Handout PDF 6.2 MB
- MTH643 Midterm Past Papers 2023 by Rashid Hussain Midterm PDF 866 KB
- MTH643 Solved Questions Lectures 9-15 Set 2 Quiz PDF 718 KB
- MTH643 Quiz Lectures 8-15 by Meher Zeeshan Haleem Quiz PDF 14 MB
- MTH643 Current Papers Solution Quiz PDF 379 KB
- MTH643 Practice Questions Solved by Mahar Afaq Safdar Muhammadi Quiz PDF 1 MB
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.