SlideShare a Scribd company logo
1 of 8
Download to read offline
clc
clear all
format short g
x=1,y=2
x =
1
y =
2
%%function call
f=Q0_01234567(x,y);
if it is like in below from reference
(1-x).^2+100*(y-x.^2).^2
ans =
100
if it is like in below from reference
output=(1-x).^2+100*(y-x.^2).^2;
disp(['Answer=' num2str(output)])
Answer=100
question 1 PART1
g = 9.8
g =
9.8
t=0:1:100;
d=Q1_01234567(t,g);
plot(t,d)
title('Distance travelled by a freely falling object');
xlabel('t (sec)');
ylabel('d (m) ');
1
PART 2
use of disp
disp(' t d')
t d
X=[t' d'];
disp(X);
0 0
1 4.9
2 19.6
3 44.1
4 78.4
5 122.5
6 176.4
7 240.1
8 313.6
9 396.9
10 490
11 592.9
12 705.6
13 828.1
14 960.4
15 1102.5
16 1254.4
2
17 1416.1
18 1587.6
19 1768.9
20 1960
21 2160.9
22 2371.6
23 2592.1
24 2822.4
25 3062.5
26 3312.4
27 3572.1
28 3841.6
29 4120.9
30 4410
31 4708.9
32 5017.6
33 5336.1
34 5664.4
35 6002.5
36 6350.4
37 6708.1
38 7075.6
39 7452.9
40 7840
41 8236.9
42 8643.6
43 9060.1
44 9486.4
45 9922.5
46 10368
47 10824
48 11290
49 11765
50 12250
51 12745
52 13250
53 13764
54 14288
55 14823
56 15366
57 15920
58 16484
59 17057
60 17640
61 18233
62 18836
63 19448
64 20070
65 20703
66 21344
67 21996
68 22658
69 23329
70 24010
71 24701
72 25402
73 26112
74 26832
75 27563
76 28302
77 29052
78 29812
79 30581
80 31360
81 32149
3
82 32948
83 33756
84 34574
85 35403
86 36240
87 37088
88 37946
89 38813
90 39690
91 40577
92 41474
93 42380
94 43296
95 44223
96 45158
97 46104
98 47060
99 48025
100 49000
use of fprintf
A=[t' d'];
fprintf('%6s %12sn','t','d');
t d
fprintf('%6.2f %12.2fn',A');
0.00 0.00
1.00 4.90
2.00 19.60
3.00 44.10
4.00 78.40
5.00 122.50
6.00 176.40
7.00 240.10
8.00 313.60
9.00 396.90
10.00 490.00
11.00 592.90
12.00 705.60
13.00 828.10
14.00 960.40
15.00 1102.50
16.00 1254.40
17.00 1416.10
18.00 1587.60
19.00 1768.90
20.00 1960.00
21.00 2160.90
22.00 2371.60
23.00 2592.10
24.00 2822.40
25.00 3062.50
26.00 3312.40
27.00 3572.10
28.00 3841.60
29.00 4120.90
30.00 4410.00
4
31.00 4708.90
32.00 5017.60
33.00 5336.10
34.00 5664.40
35.00 6002.50
36.00 6350.40
37.00 6708.10
38.00 7075.60
39.00 7452.90
40.00 7840.00
41.00 8236.90
42.00 8643.60
43.00 9060.10
44.00 9486.40
45.00 9922.50
46.00 10368.40
47.00 10824.10
48.00 11289.60
49.00 11764.90
50.00 12250.00
51.00 12744.90
52.00 13249.60
53.00 13764.10
54.00 14288.40
55.00 14822.50
56.00 15366.40
57.00 15920.10
58.00 16483.60
59.00 17056.90
60.00 17640.00
61.00 18232.90
62.00 18835.60
63.00 19448.10
64.00 20070.40
65.00 20702.50
66.00 21344.40
67.00 21996.10
68.00 22657.60
69.00 23328.90
70.00 24010.00
71.00 24700.90
72.00 25401.60
73.00 26112.10
74.00 26832.40
75.00 27562.50
76.00 28302.40
77.00 29052.10
78.00 29811.60
79.00 30580.90
80.00 31360.00
81.00 32148.90
82.00 32947.60
83.00 33756.10
84.00 34574.40
85.00 35402.50
86.00 36240.40
87.00 37088.10
88.00 37945.60
89.00 38812.90
90.00 39690.00
91.00 40576.90
92.00 41473.60
93.00 42380.10
94.00 43296.40
95.00 44222.50
5
96.00 45158.40
97.00 46104.10
98.00 47059.60
99.00 48024.90
100.00 49000.00
TASK 2
%Part 1
A=[ 2 5 8 11 14 17
3 6 9 12 15 18
4 7 10 13 16 19
5 8 11 14 17 20
6 9 12 15 18 21]
A =
2 5 8 11 14 17
3 6 9 12 15 18
4 7 10 13 16 19
5 8 11 14 17 20
6 9 12 15 18 21
B= [5 10 15 20 25 30
30 35 40 45 50 55
55 60 65 70 75 80]
B =
5 10 15 20 25 30
30 35 40 45 50 55
55 60 65 70 75 80
v=[99 98 97 96 95 94 93 92 91]
v =
99 98 97 96 95 94 93 92 91
%replace the last four columns of the first and third rows of ? with the first four
%columns of the first two rows of ?
A([1 3], [end-3:end])
ans =
8 11 14 17
10 13 16 19
A([1 3], [end-3:end])=B([1 2], [1:4])
A =
2 5 5 10 15 20
3 6 9 12 15 18
4 7 30 35 40 45
5 8 11 14 17 20
6
6 9 12 15 18 21
%replace the last four columns of the fourth row of ?
%with the elements 5 and 8 of ?
A([4], [1:4])=v([1],[5:8])
A =
2 5 5 10 15 20
3 6 9 12 15 18
4 7 30 35 40 45
95 94 93 92 17 20
6 9 12 15 18 21
%the last four columns of the fifth row of the
%? with columns 3 through 5 of the third row of ?
A([5], [1:4])=B([3], [3:6])
A =
2 5 5 10 15 20
3 6 9 12 15 18
4 7 30 35 40 45
95 94 93 92 17 20
65 70 75 80 18 21
PART B
A=[4 -2 6
2 8 2
6 10 3]
A =
4 -2 6
2 8 2
6 10 3
B=[8;4;0]
B =
8
4
0
X=inv(A)*B
X =
-1.8049
0.29268
2.6341
7
%for reference /practice only
function f=Q0_01234567(x,y)
%f=Q0_01234567(x,y)
f=(1-x).^2+100*(y-x.^2).^2;
end
%PART 1
% function of Part 1
function d=Q1_01234567(t,g)
d=(1/2)*g*t.^2;
end
8

More Related Content

What's hot

10th grade final exam review answer key
10th grade final exam review answer key10th grade final exam review answer key
10th grade final exam review answer keyJoshua Gerrard
 
Algebra ok1296541626
Algebra   ok1296541626Algebra   ok1296541626
Algebra ok1296541626Navin Joshi
 
Quadratic Functions
Quadratic FunctionsQuadratic Functions
Quadratic Functionsingroy
 
Perforacion de pozos, grupo d3 b, tarea numero 1
Perforacion de pozos, grupo d3 b, tarea numero 1Perforacion de pozos, grupo d3 b, tarea numero 1
Perforacion de pozos, grupo d3 b, tarea numero 1Kt Silva
 
Period 4 Quadratic Funtions
Period 4 Quadratic FuntionsPeriod 4 Quadratic Funtions
Period 4 Quadratic Funtionsingroy
 
Unit 2 review jeopardy game(2)
Unit 2 review jeopardy game(2)Unit 2 review jeopardy game(2)
Unit 2 review jeopardy game(2)Dawn Adams2
 
Quantitative techniques for MBA (QDM)
Quantitative techniques for MBA (QDM)Quantitative techniques for MBA (QDM)
Quantitative techniques for MBA (QDM)npazare
 
Percentages - Variables
Percentages - VariablesPercentages - Variables
Percentages - Variables2IIM
 
Determine bending moment and share force diagram of beam
Determine bending moment and share force diagram of beamDetermine bending moment and share force diagram of beam
Determine bending moment and share force diagram of beamTurja Deb
 
Fisica matematica final
Fisica matematica finalFisica matematica final
Fisica matematica finaldanbohe
 
STRESS ANALYSIS OF TRACTOR’S FRONT-END BUCKET USING MOHR'S CIRCLE
STRESS ANALYSIS OF TRACTOR’S FRONT-END BUCKET  USING MOHR'S CIRCLESTRESS ANALYSIS OF TRACTOR’S FRONT-END BUCKET  USING MOHR'S CIRCLE
STRESS ANALYSIS OF TRACTOR’S FRONT-END BUCKET USING MOHR'S CIRCLEWahid Dino Samo
 
One way ANOVA balanced design
One way ANOVA balanced designOne way ANOVA balanced design
One way ANOVA balanced designWaleed Zaghal
 
Clock Aptitude Questions and Answers | Clock Aptitude Problem | JobzStore
Clock Aptitude Questions and Answers | Clock Aptitude Problem | JobzStoreClock Aptitude Questions and Answers | Clock Aptitude Problem | JobzStore
Clock Aptitude Questions and Answers | Clock Aptitude Problem | JobzStoreashwamegh patil
 

What's hot (20)

10th grade final exam review answer key
10th grade final exam review answer key10th grade final exam review answer key
10th grade final exam review answer key
 
Daa unit iv - problems
Daa   unit  iv - problemsDaa   unit  iv - problems
Daa unit iv - problems
 
Algebra
AlgebraAlgebra
Algebra
 
Algebra ok1296541626
Algebra   ok1296541626Algebra   ok1296541626
Algebra ok1296541626
 
Solution 1
Solution 1Solution 1
Solution 1
 
Quadratic Functions
Quadratic FunctionsQuadratic Functions
Quadratic Functions
 
Perforacion de pozos, grupo d3 b, tarea numero 1
Perforacion de pozos, grupo d3 b, tarea numero 1Perforacion de pozos, grupo d3 b, tarea numero 1
Perforacion de pozos, grupo d3 b, tarea numero 1
 
Period 4 Quadratic Funtions
Period 4 Quadratic FuntionsPeriod 4 Quadratic Funtions
Period 4 Quadratic Funtions
 
Lesson 7: Determinants II
Lesson 7: Determinants IILesson 7: Determinants II
Lesson 7: Determinants II
 
Unit 2 review jeopardy game(2)
Unit 2 review jeopardy game(2)Unit 2 review jeopardy game(2)
Unit 2 review jeopardy game(2)
 
Quantitative techniques for MBA (QDM)
Quantitative techniques for MBA (QDM)Quantitative techniques for MBA (QDM)
Quantitative techniques for MBA (QDM)
 
Percentages - Variables
Percentages - VariablesPercentages - Variables
Percentages - Variables
 
Determine bending moment and share force diagram of beam
Determine bending moment and share force diagram of beamDetermine bending moment and share force diagram of beam
Determine bending moment and share force diagram of beam
 
Matlab
MatlabMatlab
Matlab
 
Problema dual
Problema dualProblema dual
Problema dual
 
Fisica matematica final
Fisica matematica finalFisica matematica final
Fisica matematica final
 
Appendices Part 2 (Thesis)
Appendices Part 2 (Thesis)Appendices Part 2 (Thesis)
Appendices Part 2 (Thesis)
 
STRESS ANALYSIS OF TRACTOR’S FRONT-END BUCKET USING MOHR'S CIRCLE
STRESS ANALYSIS OF TRACTOR’S FRONT-END BUCKET  USING MOHR'S CIRCLESTRESS ANALYSIS OF TRACTOR’S FRONT-END BUCKET  USING MOHR'S CIRCLE
STRESS ANALYSIS OF TRACTOR’S FRONT-END BUCKET USING MOHR'S CIRCLE
 
One way ANOVA balanced design
One way ANOVA balanced designOne way ANOVA balanced design
One way ANOVA balanced design
 
Clock Aptitude Questions and Answers | Clock Aptitude Problem | JobzStore
Clock Aptitude Questions and Answers | Clock Aptitude Problem | JobzStoreClock Aptitude Questions and Answers | Clock Aptitude Problem | JobzStore
Clock Aptitude Questions and Answers | Clock Aptitude Problem | JobzStore
 

Similar to Matlab Sample Assignment Solution

System dynamics 3rd edition palm solutions manual
System dynamics 3rd edition palm solutions manualSystem dynamics 3rd edition palm solutions manual
System dynamics 3rd edition palm solutions manualSextonMales
 
Solucionario_Diseno_en_Ingenieria_Mecani (1).pdf
Solucionario_Diseno_en_Ingenieria_Mecani (1).pdfSolucionario_Diseno_en_Ingenieria_Mecani (1).pdf
Solucionario_Diseno_en_Ingenieria_Mecani (1).pdfDannyCoronel5
 
Solucionario_Diseno_en_Ingenieria_Mecani.pdf
Solucionario_Diseno_en_Ingenieria_Mecani.pdfSolucionario_Diseno_en_Ingenieria_Mecani.pdf
Solucionario_Diseno_en_Ingenieria_Mecani.pdffranciscoantoniomonr1
 
Solutions_Manual_to_accompany_Applied_Nu.pdf
Solutions_Manual_to_accompany_Applied_Nu.pdfSolutions_Manual_to_accompany_Applied_Nu.pdf
Solutions_Manual_to_accompany_Applied_Nu.pdfWaleedHussain30
 
Solutions completo elementos de maquinas de shigley 8th edition
Solutions completo elementos de maquinas de shigley 8th editionSolutions completo elementos de maquinas de shigley 8th edition
Solutions completo elementos de maquinas de shigley 8th editionfercrotti
 
Capítulo 02 considerações estatísticas
Capítulo 02   considerações estatísticasCapítulo 02   considerações estatísticas
Capítulo 02 considerações estatísticasJhayson Carvalho
 
EJERCICIOS RESUELTOS DE LOGARITMOS
EJERCICIOS RESUELTOS DE LOGARITMOSEJERCICIOS RESUELTOS DE LOGARITMOS
EJERCICIOS RESUELTOS DE LOGARITMOSADRIANULLOAP
 
Solution shigley's
Solution shigley'sSolution shigley's
Solution shigley'sAlemu Abera
 
Shigley 13830681 solution mechanical engineering design shigley 7th edition
Shigley 13830681 solution mechanical engineering design shigley 7th editionShigley 13830681 solution mechanical engineering design shigley 7th edition
Shigley 13830681 solution mechanical engineering design shigley 7th editionLuis Eduin
 
Questions on Verbal & Non Verbal Reasoning
Questions on Verbal & Non Verbal ReasoningQuestions on Verbal & Non Verbal Reasoning
Questions on Verbal & Non Verbal ReasoningLearnPick
 
RunHeading (x1).docx
RunHeading (x1).docxRunHeading (x1).docx
RunHeading (x1).docxSUBHI7
 

Similar to Matlab Sample Assignment Solution (20)

Shi20396 ch03
Shi20396 ch03Shi20396 ch03
Shi20396 ch03
 
System dynamics 3rd edition palm solutions manual
System dynamics 3rd edition palm solutions manualSystem dynamics 3rd edition palm solutions manual
System dynamics 3rd edition palm solutions manual
 
Tugas blog-matematika
Tugas blog-matematikaTugas blog-matematika
Tugas blog-matematika
 
Solucionario_Diseno_en_Ingenieria_Mecani (1).pdf
Solucionario_Diseno_en_Ingenieria_Mecani (1).pdfSolucionario_Diseno_en_Ingenieria_Mecani (1).pdf
Solucionario_Diseno_en_Ingenieria_Mecani (1).pdf
 
Solucionario_Diseno_en_Ingenieria_Mecani.pdf
Solucionario_Diseno_en_Ingenieria_Mecani.pdfSolucionario_Diseno_en_Ingenieria_Mecani.pdf
Solucionario_Diseno_en_Ingenieria_Mecani.pdf
 
Solutions_Manual_to_accompany_Applied_Nu.pdf
Solutions_Manual_to_accompany_Applied_Nu.pdfSolutions_Manual_to_accompany_Applied_Nu.pdf
Solutions_Manual_to_accompany_Applied_Nu.pdf
 
Capítulo 03 materiais
Capítulo 03   materiaisCapítulo 03   materiais
Capítulo 03 materiais
 
Ch02
Ch02Ch02
Ch02
 
Palm ch1
Palm ch1Palm ch1
Palm ch1
 
sm ch2 open akan.pdf
sm ch2 open akan.pdfsm ch2 open akan.pdf
sm ch2 open akan.pdf
 
Examen final
Examen finalExamen final
Examen final
 
Solutions completo elementos de maquinas de shigley 8th edition
Solutions completo elementos de maquinas de shigley 8th editionSolutions completo elementos de maquinas de shigley 8th edition
Solutions completo elementos de maquinas de shigley 8th edition
 
Metode nakayasu
Metode nakayasuMetode nakayasu
Metode nakayasu
 
Capítulo 02 considerações estatísticas
Capítulo 02   considerações estatísticasCapítulo 02   considerações estatísticas
Capítulo 02 considerações estatísticas
 
EJERCICIOS RESUELTOS DE LOGARITMOS
EJERCICIOS RESUELTOS DE LOGARITMOSEJERCICIOS RESUELTOS DE LOGARITMOS
EJERCICIOS RESUELTOS DE LOGARITMOS
 
TP3.pdf
TP3.pdfTP3.pdf
TP3.pdf
 
Solution shigley's
Solution shigley'sSolution shigley's
Solution shigley's
 
Shigley 13830681 solution mechanical engineering design shigley 7th edition
Shigley 13830681 solution mechanical engineering design shigley 7th editionShigley 13830681 solution mechanical engineering design shigley 7th edition
Shigley 13830681 solution mechanical engineering design shigley 7th edition
 
Questions on Verbal & Non Verbal Reasoning
Questions on Verbal & Non Verbal ReasoningQuestions on Verbal & Non Verbal Reasoning
Questions on Verbal & Non Verbal Reasoning
 
RunHeading (x1).docx
RunHeading (x1).docxRunHeading (x1).docx
RunHeading (x1).docx
 

More from All Assignment Experts

More from All Assignment Experts (8)

ENGINEERING PROJECT – CONVEYOR BLOCKAGE DETECTION
ENGINEERING PROJECT – CONVEYOR BLOCKAGE DETECTIONENGINEERING PROJECT – CONVEYOR BLOCKAGE DETECTION
ENGINEERING PROJECT – CONVEYOR BLOCKAGE DETECTION
 
Business strategy Assignment Help
Business strategy Assignment HelpBusiness strategy Assignment Help
Business strategy Assignment Help
 
Business laws sample assignment
Business laws sample assignmentBusiness laws sample assignment
Business laws sample assignment
 
Essay writing sample_assignment
Essay writing sample_assignmentEssay writing sample_assignment
Essay writing sample_assignment
 
Mathematics sample assignment
Mathematics sample assignmentMathematics sample assignment
Mathematics sample assignment
 
Civil Engineering Sample Assignment Solution
Civil Engineering Sample Assignment Solution Civil Engineering Sample Assignment Solution
Civil Engineering Sample Assignment Solution
 
Electrical Engineering Sample Assignment
Electrical Engineering Sample AssignmentElectrical Engineering Sample Assignment
Electrical Engineering Sample Assignment
 
Matlab Sample Assignment Solution
Matlab Sample Assignment SolutionMatlab Sample Assignment Solution
Matlab Sample Assignment Solution
 

Recently uploaded

ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 

Recently uploaded (20)

ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 

Matlab Sample Assignment Solution

  • 1. clc clear all format short g x=1,y=2 x = 1 y = 2 %%function call f=Q0_01234567(x,y); if it is like in below from reference (1-x).^2+100*(y-x.^2).^2 ans = 100 if it is like in below from reference output=(1-x).^2+100*(y-x.^2).^2; disp(['Answer=' num2str(output)]) Answer=100 question 1 PART1 g = 9.8 g = 9.8 t=0:1:100; d=Q1_01234567(t,g); plot(t,d) title('Distance travelled by a freely falling object'); xlabel('t (sec)'); ylabel('d (m) '); 1
  • 2. PART 2 use of disp disp(' t d') t d X=[t' d']; disp(X); 0 0 1 4.9 2 19.6 3 44.1 4 78.4 5 122.5 6 176.4 7 240.1 8 313.6 9 396.9 10 490 11 592.9 12 705.6 13 828.1 14 960.4 15 1102.5 16 1254.4 2
  • 3. 17 1416.1 18 1587.6 19 1768.9 20 1960 21 2160.9 22 2371.6 23 2592.1 24 2822.4 25 3062.5 26 3312.4 27 3572.1 28 3841.6 29 4120.9 30 4410 31 4708.9 32 5017.6 33 5336.1 34 5664.4 35 6002.5 36 6350.4 37 6708.1 38 7075.6 39 7452.9 40 7840 41 8236.9 42 8643.6 43 9060.1 44 9486.4 45 9922.5 46 10368 47 10824 48 11290 49 11765 50 12250 51 12745 52 13250 53 13764 54 14288 55 14823 56 15366 57 15920 58 16484 59 17057 60 17640 61 18233 62 18836 63 19448 64 20070 65 20703 66 21344 67 21996 68 22658 69 23329 70 24010 71 24701 72 25402 73 26112 74 26832 75 27563 76 28302 77 29052 78 29812 79 30581 80 31360 81 32149 3
  • 4. 82 32948 83 33756 84 34574 85 35403 86 36240 87 37088 88 37946 89 38813 90 39690 91 40577 92 41474 93 42380 94 43296 95 44223 96 45158 97 46104 98 47060 99 48025 100 49000 use of fprintf A=[t' d']; fprintf('%6s %12sn','t','d'); t d fprintf('%6.2f %12.2fn',A'); 0.00 0.00 1.00 4.90 2.00 19.60 3.00 44.10 4.00 78.40 5.00 122.50 6.00 176.40 7.00 240.10 8.00 313.60 9.00 396.90 10.00 490.00 11.00 592.90 12.00 705.60 13.00 828.10 14.00 960.40 15.00 1102.50 16.00 1254.40 17.00 1416.10 18.00 1587.60 19.00 1768.90 20.00 1960.00 21.00 2160.90 22.00 2371.60 23.00 2592.10 24.00 2822.40 25.00 3062.50 26.00 3312.40 27.00 3572.10 28.00 3841.60 29.00 4120.90 30.00 4410.00 4
  • 5. 31.00 4708.90 32.00 5017.60 33.00 5336.10 34.00 5664.40 35.00 6002.50 36.00 6350.40 37.00 6708.10 38.00 7075.60 39.00 7452.90 40.00 7840.00 41.00 8236.90 42.00 8643.60 43.00 9060.10 44.00 9486.40 45.00 9922.50 46.00 10368.40 47.00 10824.10 48.00 11289.60 49.00 11764.90 50.00 12250.00 51.00 12744.90 52.00 13249.60 53.00 13764.10 54.00 14288.40 55.00 14822.50 56.00 15366.40 57.00 15920.10 58.00 16483.60 59.00 17056.90 60.00 17640.00 61.00 18232.90 62.00 18835.60 63.00 19448.10 64.00 20070.40 65.00 20702.50 66.00 21344.40 67.00 21996.10 68.00 22657.60 69.00 23328.90 70.00 24010.00 71.00 24700.90 72.00 25401.60 73.00 26112.10 74.00 26832.40 75.00 27562.50 76.00 28302.40 77.00 29052.10 78.00 29811.60 79.00 30580.90 80.00 31360.00 81.00 32148.90 82.00 32947.60 83.00 33756.10 84.00 34574.40 85.00 35402.50 86.00 36240.40 87.00 37088.10 88.00 37945.60 89.00 38812.90 90.00 39690.00 91.00 40576.90 92.00 41473.60 93.00 42380.10 94.00 43296.40 95.00 44222.50 5
  • 6. 96.00 45158.40 97.00 46104.10 98.00 47059.60 99.00 48024.90 100.00 49000.00 TASK 2 %Part 1 A=[ 2 5 8 11 14 17 3 6 9 12 15 18 4 7 10 13 16 19 5 8 11 14 17 20 6 9 12 15 18 21] A = 2 5 8 11 14 17 3 6 9 12 15 18 4 7 10 13 16 19 5 8 11 14 17 20 6 9 12 15 18 21 B= [5 10 15 20 25 30 30 35 40 45 50 55 55 60 65 70 75 80] B = 5 10 15 20 25 30 30 35 40 45 50 55 55 60 65 70 75 80 v=[99 98 97 96 95 94 93 92 91] v = 99 98 97 96 95 94 93 92 91 %replace the last four columns of the first and third rows of ? with the first four %columns of the first two rows of ? A([1 3], [end-3:end]) ans = 8 11 14 17 10 13 16 19 A([1 3], [end-3:end])=B([1 2], [1:4]) A = 2 5 5 10 15 20 3 6 9 12 15 18 4 7 30 35 40 45 5 8 11 14 17 20 6
  • 7. 6 9 12 15 18 21 %replace the last four columns of the fourth row of ? %with the elements 5 and 8 of ? A([4], [1:4])=v([1],[5:8]) A = 2 5 5 10 15 20 3 6 9 12 15 18 4 7 30 35 40 45 95 94 93 92 17 20 6 9 12 15 18 21 %the last four columns of the fifth row of the %? with columns 3 through 5 of the third row of ? A([5], [1:4])=B([3], [3:6]) A = 2 5 5 10 15 20 3 6 9 12 15 18 4 7 30 35 40 45 95 94 93 92 17 20 65 70 75 80 18 21 PART B A=[4 -2 6 2 8 2 6 10 3] A = 4 -2 6 2 8 2 6 10 3 B=[8;4;0] B = 8 4 0 X=inv(A)*B X = -1.8049 0.29268 2.6341 7
  • 8. %for reference /practice only function f=Q0_01234567(x,y) %f=Q0_01234567(x,y) f=(1-x).^2+100*(y-x.^2).^2; end %PART 1 % function of Part 1 function d=Q1_01234567(t,g) d=(1/2)*g*t.^2; end 8