SlideShare une entreprise Scribd logo
1  sur  3
Télécharger pour lire hors ligne
1/3Smee
Matlab (TP1) 25%pt
1. Vectors and Matrices Initialize the following variables:
A=[
5 … 5
⋮ ⋱ ⋮
5 … 5
]
9×9
(use ones,zeros) ,B= (A 9x9 matrix of all 0 but with the values [1 2 3 4 5 4 3 2 1] on
diagonal, use zeros, diag) C= (A 3x4 matrix, use NaN) ,D=
2. Define the vector V = [0 1 2 ... 39 40]. What is the size of this vector? Define the vector W containing the first five and the last
five elements of V then define the vector Z = [0 2 4 ... 38 40] from V.
3. Define the matrix What are its dimensions m x n? Extract from this matrix
and .. Make a matrix Q obtained by taking the matrix M intersected between all the 3rd
rows
and one column out of 2. Calculate the matrix products NP = N x P, NtQ = N 'x Q and NQ = N x Q, then comment the results.
4. Define the variable 𝑥 = [
𝜋
6
,
𝜋
4
,
𝜋
3
] and calculate y1=sin(x) and y2=cos(x) Then calculate tan(x) using only the previous y1 and y2.
5. The following vectors are considered:
𝑢 = (
1
2
3
) , 𝑣 = (
−5
2
1
) 𝑎𝑛𝑑 𝑤 = (
−1
−3
7
)
a. Calculate t=u+3v-5w
b. Calculate ‖𝑢‖, ‖𝑣‖, ‖𝑤‖ and the cosine of the angle α formed by the vectors u and v, and α in degrees.
6. Application:This problem requires you to generate temperature conversion tables. Use the following equations, which describe
the relationships between tempera-tures in degrees Fahrenheit(TF) , degrees Celsius(TC), kelvins( TK ) , and degrees Rankine
(TR ) , respectively: 𝑇𝐹 = 𝑇𝑅 − 459.67 𝑜
𝑅, 𝑇𝐹 =
9
5
𝑇𝐶 + 32 𝑜
𝐹, 𝑇𝑅 =
9
5
𝑇𝑘 You will need to rearrange these expressions to solve
some of the problems.
(a) Generate a table of conversions from Fahrenheit to Kelvin for values from 0°F to 200°F. Allow the user to enter the
increments in degrees F between lines. Use disp and fprintf to create a table with a title, column headings, and appropriate
spacing.
(b) Generate a table of conversions from Celsius to Rankine. Allow the user to enter the starting temperature and the increment
between lines. Print 25 lines in the table. Use disp and fprintf to create a table with a title, column headings, and appropriate
spacing.
(c) Generate a table of conversions from Celsius to Fahrenheit. Allow the user to enter the starting temperature, the increment
between lines, and the number of lines for the table. Use disp and fprintf to create a table with a title, column headings, and
appropriate spacing.
7. Defined function Write in Matlab to find roots of quadratic equation 𝑦 = 𝑎𝑥2
+ 𝑏𝑥 + 𝑐 by contained the roots 𝑥 = [𝑥1 𝑥2].
Now, apply your program for the following cases:
a. a=1,b=7,c=12 b. a=1,b=-4,c=4 c. a=1,b=2,c=3
8. Using a function to calculate the volume of liquid (V) in a spherical tank,
given the depth of the liquid (h) and the radius (R).
V=SphereTank(R,h)
Now, apply your program for the following cases:
a. R=2,h=1 b. R=h=5 𝑉 =
𝜋ℎ2(3𝑅−ℎ)
3
2/3Smee
Solution
1.
A=5*ones(9) or A=5.+zeros(5,5)
B. a=[1:5,4:-1:1]
b=diag(a)
c=zeros(9,9)
D=b+c
or D=diag([1:5,4:-1:1])+zeros(9,9)
C=NaN(3,4)
D=([1:10;11:20;21:30;31:40;41:50;51:60;61:70;71:80;81:90;91:100])'
2.
V=[0:40]
size(V)
W=[V(:,1:5) V(:,37:41)]
Z=V(:,[1:2:40])
3.
M=[1:10;11:20;21:30]
size(M)
N=M(:,1:2)
P=M([1 3],[3 7])
Q=M(:,[1:2:10])
NP=N*P
NtQ=N'*Q
NQ=
%Error because both its size is not available for multiple matric
4.
x=[pi/6 pi/4 pi/3]
y1=sin(x)
y2=cos(x)
y=y1./y2
5.
u=[1;2;3]
v=[-5;2;1]
w=[-1;-3;7]
t=u+3*v-5*w
U=norm(u)
V=norm(v)
W=norm(w)
z=dot(u,v);
a=z/[U*V]
b=acosd(a)
6.
a.
incr=input('put the value of the incressing temperature')
F=0:incr:200;
K=(5.*(F+459.67)./9);
table=[F;K];
disp('Conversions from Fahrenheit to kelvin')
disp('In_F conversion to Kelvin')
fprintf('%3.4f %3.4frn',table);
b.
S=input('put the value of the starting temperature')
C=linspace(S,200,25);
R=(C+273.15).*1.8;
table=[C;R];
disp('Conversions from C to Rekin')
3/3Smee
disp('In_C conversion to Rekin')
fprintf('%3.4f %3.4frn',table);
c.
S=input('put the value of the starting temperature')
incr=input('put the value of the incressing temperature')
C=linspace(S,200,incr);
F=1.8.*C+32
table=[C;F];
disp('Conversions from C to F')
disp('In_C conversion to F')
fprintf('%3.4f %3.4frn',table);
7. Defined Function
function x = quadratic(a,b,c)
delta = 4*a*c;
denom = 2*a;
rootdisc = sqrt(b.^2 - delta); % Square root of the discriminant
x1 = (-b + rootdisc)./denom;
x2 = (-b - rootdisc)./denom;
x = [x1 x2];
end
Comment Window
quadratic(1,7,12)
quadratic(1,-4,4)
quadratic(1,2,3)
8.
function volume=SphereTank(radius,depth)
volume= pi*depth.^2*(3.*radius-depth)/3;
end
Comment Window
SphereTank(2,1)
SphereTank(5,5)
______________________________________________________________________________________________________________________
8/13/2017
5:32PM
Corrected by
Mr.Smee Kaem Chann
Tel : +885965235960

Contenu connexe

Tendances

Tendances (19)

Lecture 6
Lecture 6Lecture 6
Lecture 6
 
Goldie chapter 4 function
Goldie chapter 4 functionGoldie chapter 4 function
Goldie chapter 4 function
 
Solution of matlab chapter 6
Solution of matlab chapter 6Solution of matlab chapter 6
Solution of matlab chapter 6
 
lecture 15
lecture 15lecture 15
lecture 15
 
Matrices
MatricesMatrices
Matrices
 
Basic concepts. Systems of equations
Basic concepts. Systems of equationsBasic concepts. Systems of equations
Basic concepts. Systems of equations
 
4R2012 preTest12A
4R2012 preTest12A4R2012 preTest12A
4R2012 preTest12A
 
algo1
algo1algo1
algo1
 
Trigonometric functions
Trigonometric functionsTrigonometric functions
Trigonometric functions
 
Karnaugh maps
Karnaugh mapsKarnaugh maps
Karnaugh maps
 
Karnaugh maps
Karnaugh mapsKarnaugh maps
Karnaugh maps
 
Lesson 3
Lesson 3Lesson 3
Lesson 3
 
4R2012 preTest11A
4R2012 preTest11A4R2012 preTest11A
4R2012 preTest11A
 
08 mtp11 applied mathematics - dec 2009,jan 2010
08 mtp11  applied mathematics - dec 2009,jan 201008 mtp11  applied mathematics - dec 2009,jan 2010
08 mtp11 applied mathematics - dec 2009,jan 2010
 
Differential Equations Homework Help
Differential Equations Homework HelpDifferential Equations Homework Help
Differential Equations Homework Help
 
Matrices
MatricesMatrices
Matrices
 
4R2012 preTest2A
4R2012 preTest2A4R2012 preTest2A
4R2012 preTest2A
 
Differential Equations Assignment Help
Differential Equations Assignment HelpDifferential Equations Assignment Help
Differential Equations Assignment Help
 
Matlab lecture 6 – newton raphson method@taj copy
Matlab lecture 6 – newton raphson method@taj   copyMatlab lecture 6 – newton raphson method@taj   copy
Matlab lecture 6 – newton raphson method@taj copy
 

Similaire à Matlab temperature conversion tables

MATLAB review questions 2014 15
MATLAB review questions 2014 15MATLAB review questions 2014 15
MATLAB review questions 2014 15chingtony mbuma
 
MATLAB sessions Laboratory 2MAT 275 Laboratory 2Matrix .docx
MATLAB sessions Laboratory 2MAT 275 Laboratory 2Matrix .docxMATLAB sessions Laboratory 2MAT 275 Laboratory 2Matrix .docx
MATLAB sessions Laboratory 2MAT 275 Laboratory 2Matrix .docxandreecapon
 
Q1Perform the two basic operations of multiplication and divisio.docx
Q1Perform the two basic operations of multiplication and divisio.docxQ1Perform the two basic operations of multiplication and divisio.docx
Q1Perform the two basic operations of multiplication and divisio.docxamrit47
 
Matlab practice
Matlab practiceMatlab practice
Matlab practiceZunAib Ali
 
Programming for Mechanical Engineers in EES
Programming for Mechanical Engineers in EESProgramming for Mechanical Engineers in EES
Programming for Mechanical Engineers in EESNaveed Rehman
 
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docxSAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docxanhlodge
 
Lab 5 template Lab 5 - Your Name - MAT 275 Lab The M.docx
Lab 5 template  Lab 5 - Your Name - MAT 275 Lab The M.docxLab 5 template  Lab 5 - Your Name - MAT 275 Lab The M.docx
Lab 5 template Lab 5 - Your Name - MAT 275 Lab The M.docxsmile790243
 
Solution of matlab chapter 3
Solution of matlab chapter 3Solution of matlab chapter 3
Solution of matlab chapter 3AhsanIrshad8
 
M210 Songyue.pages__MACOSX._M210 Songyue.pagesM210-S16-.docx
M210 Songyue.pages__MACOSX._M210 Songyue.pagesM210-S16-.docxM210 Songyue.pages__MACOSX._M210 Songyue.pagesM210-S16-.docx
M210 Songyue.pages__MACOSX._M210 Songyue.pagesM210-S16-.docxsmile790243
 
INTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptxINTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptxDevaraj Chilakala
 
COMPANION TO MATRICES SESSION II.pptx
COMPANION TO MATRICES SESSION II.pptxCOMPANION TO MATRICES SESSION II.pptx
COMPANION TO MATRICES SESSION II.pptximman gwu
 
Matlab intro notes
Matlab intro notesMatlab intro notes
Matlab intro notespawanss
 
B61301007 matlab documentation
B61301007 matlab documentationB61301007 matlab documentation
B61301007 matlab documentationManchireddy Reddy
 

Similaire à Matlab temperature conversion tables (20)

MATLAB review questions 2014 15
MATLAB review questions 2014 15MATLAB review questions 2014 15
MATLAB review questions 2014 15
 
MATLAB sessions Laboratory 2MAT 275 Laboratory 2Matrix .docx
MATLAB sessions Laboratory 2MAT 275 Laboratory 2Matrix .docxMATLAB sessions Laboratory 2MAT 275 Laboratory 2Matrix .docx
MATLAB sessions Laboratory 2MAT 275 Laboratory 2Matrix .docx
 
Q1Perform the two basic operations of multiplication and divisio.docx
Q1Perform the two basic operations of multiplication and divisio.docxQ1Perform the two basic operations of multiplication and divisio.docx
Q1Perform the two basic operations of multiplication and divisio.docx
 
Algorithm Homework Help
Algorithm Homework HelpAlgorithm Homework Help
Algorithm Homework Help
 
Matlab practice
Matlab practiceMatlab practice
Matlab practice
 
Matlab booklet
Matlab bookletMatlab booklet
Matlab booklet
 
Programming for Mechanical Engineers in EES
Programming for Mechanical Engineers in EESProgramming for Mechanical Engineers in EES
Programming for Mechanical Engineers in EES
 
A02
A02A02
A02
 
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docxSAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
 
Lab 5 template Lab 5 - Your Name - MAT 275 Lab The M.docx
Lab 5 template  Lab 5 - Your Name - MAT 275 Lab The M.docxLab 5 template  Lab 5 - Your Name - MAT 275 Lab The M.docx
Lab 5 template Lab 5 - Your Name - MAT 275 Lab The M.docx
 
Solution of matlab chapter 3
Solution of matlab chapter 3Solution of matlab chapter 3
Solution of matlab chapter 3
 
M210 Songyue.pages__MACOSX._M210 Songyue.pagesM210-S16-.docx
M210 Songyue.pages__MACOSX._M210 Songyue.pagesM210-S16-.docxM210 Songyue.pages__MACOSX._M210 Songyue.pagesM210-S16-.docx
M210 Songyue.pages__MACOSX._M210 Songyue.pagesM210-S16-.docx
 
INTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptxINTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptx
 
COMPANION TO MATRICES SESSION II.pptx
COMPANION TO MATRICES SESSION II.pptxCOMPANION TO MATRICES SESSION II.pptx
COMPANION TO MATRICES SESSION II.pptx
 
Matlab intro notes
Matlab intro notesMatlab intro notes
Matlab intro notes
 
NCIT civil Syllabus 2013-2014
NCIT civil Syllabus 2013-2014NCIT civil Syllabus 2013-2014
NCIT civil Syllabus 2013-2014
 
B61301007 matlab documentation
B61301007 matlab documentationB61301007 matlab documentation
B61301007 matlab documentation
 
Linear Algebra Assignment help
Linear Algebra Assignment helpLinear Algebra Assignment help
Linear Algebra Assignment help
 
Calculus Assignment Help
 Calculus Assignment Help Calculus Assignment Help
Calculus Assignment Help
 
Tarea1
Tarea1Tarea1
Tarea1
 

Plus de Smee Kaem Chann

Plus de Smee Kaem Chann (20)

stress-and-strain
stress-and-strainstress-and-strain
stress-and-strain
 
Robot khmer engineer
Robot khmer engineerRobot khmer engineer
Robot khmer engineer
 
15 poteau-2
15 poteau-215 poteau-2
15 poteau-2
 
14 poteau-1
14 poteau-114 poteau-1
14 poteau-1
 
12 plancher-Eurocode 2
12 plancher-Eurocode 212 plancher-Eurocode 2
12 plancher-Eurocode 2
 
Matlab_Prof Pouv Keangsé
Matlab_Prof Pouv KeangséMatlab_Prof Pouv Keangsé
Matlab_Prof Pouv Keangsé
 
Vocabuary
VocabuaryVocabuary
Vocabuary
 
Journal de bord
Journal de bordJournal de bord
Journal de bord
 
8.4 roof leader
8.4 roof leader8.4 roof leader
8.4 roof leader
 
Rapport de stage
Rapport de stage Rapport de stage
Rapport de stage
 
Td triphasé
Td triphaséTd triphasé
Td triphasé
 
Tp2 Matlab
Tp2 MatlabTp2 Matlab
Tp2 Matlab
 
Cover matlab
Cover matlabCover matlab
Cover matlab
 
New Interchange 3ed edition Vocabulary unit 8
New Interchange 3ed edition Vocabulary unit 8 New Interchange 3ed edition Vocabulary unit 8
New Interchange 3ed edition Vocabulary unit 8
 
Matlab Travaux Pratique
Matlab Travaux Pratique Matlab Travaux Pratique
Matlab Travaux Pratique
 
The technologies of building resists the wind load and earthquake
The technologies of building resists the wind load and earthquakeThe technologies of building resists the wind load and earthquake
The technologies of building resists the wind load and earthquake
 
Devoir d'électricite des bêtiment
Devoir d'électricite des bêtimentDevoir d'électricite des bêtiment
Devoir d'électricite des bêtiment
 
Rapport topographie 2016-2017
Rapport topographie 2016-2017  Rapport topographie 2016-2017
Rapport topographie 2016-2017
 
Case study: Probability and Statistic
Case study: Probability and StatisticCase study: Probability and Statistic
Case study: Probability and Statistic
 
Hydrologie générale
Hydrologie générale Hydrologie générale
Hydrologie générale
 

Dernier

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
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
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 

Dernier (20)

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
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
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 

Matlab temperature conversion tables

  • 1. 1/3Smee Matlab (TP1) 25%pt 1. Vectors and Matrices Initialize the following variables: A=[ 5 … 5 ⋮ ⋱ ⋮ 5 … 5 ] 9×9 (use ones,zeros) ,B= (A 9x9 matrix of all 0 but with the values [1 2 3 4 5 4 3 2 1] on diagonal, use zeros, diag) C= (A 3x4 matrix, use NaN) ,D= 2. Define the vector V = [0 1 2 ... 39 40]. What is the size of this vector? Define the vector W containing the first five and the last five elements of V then define the vector Z = [0 2 4 ... 38 40] from V. 3. Define the matrix What are its dimensions m x n? Extract from this matrix and .. Make a matrix Q obtained by taking the matrix M intersected between all the 3rd rows and one column out of 2. Calculate the matrix products NP = N x P, NtQ = N 'x Q and NQ = N x Q, then comment the results. 4. Define the variable 𝑥 = [ 𝜋 6 , 𝜋 4 , 𝜋 3 ] and calculate y1=sin(x) and y2=cos(x) Then calculate tan(x) using only the previous y1 and y2. 5. The following vectors are considered: 𝑢 = ( 1 2 3 ) , 𝑣 = ( −5 2 1 ) 𝑎𝑛𝑑 𝑤 = ( −1 −3 7 ) a. Calculate t=u+3v-5w b. Calculate ‖𝑢‖, ‖𝑣‖, ‖𝑤‖ and the cosine of the angle α formed by the vectors u and v, and α in degrees. 6. Application:This problem requires you to generate temperature conversion tables. Use the following equations, which describe the relationships between tempera-tures in degrees Fahrenheit(TF) , degrees Celsius(TC), kelvins( TK ) , and degrees Rankine (TR ) , respectively: 𝑇𝐹 = 𝑇𝑅 − 459.67 𝑜 𝑅, 𝑇𝐹 = 9 5 𝑇𝐶 + 32 𝑜 𝐹, 𝑇𝑅 = 9 5 𝑇𝑘 You will need to rearrange these expressions to solve some of the problems. (a) Generate a table of conversions from Fahrenheit to Kelvin for values from 0°F to 200°F. Allow the user to enter the increments in degrees F between lines. Use disp and fprintf to create a table with a title, column headings, and appropriate spacing. (b) Generate a table of conversions from Celsius to Rankine. Allow the user to enter the starting temperature and the increment between lines. Print 25 lines in the table. Use disp and fprintf to create a table with a title, column headings, and appropriate spacing. (c) Generate a table of conversions from Celsius to Fahrenheit. Allow the user to enter the starting temperature, the increment between lines, and the number of lines for the table. Use disp and fprintf to create a table with a title, column headings, and appropriate spacing. 7. Defined function Write in Matlab to find roots of quadratic equation 𝑦 = 𝑎𝑥2 + 𝑏𝑥 + 𝑐 by contained the roots 𝑥 = [𝑥1 𝑥2]. Now, apply your program for the following cases: a. a=1,b=7,c=12 b. a=1,b=-4,c=4 c. a=1,b=2,c=3 8. Using a function to calculate the volume of liquid (V) in a spherical tank, given the depth of the liquid (h) and the radius (R). V=SphereTank(R,h) Now, apply your program for the following cases: a. R=2,h=1 b. R=h=5 𝑉 = 𝜋ℎ2(3𝑅−ℎ) 3
  • 2. 2/3Smee Solution 1. A=5*ones(9) or A=5.+zeros(5,5) B. a=[1:5,4:-1:1] b=diag(a) c=zeros(9,9) D=b+c or D=diag([1:5,4:-1:1])+zeros(9,9) C=NaN(3,4) D=([1:10;11:20;21:30;31:40;41:50;51:60;61:70;71:80;81:90;91:100])' 2. V=[0:40] size(V) W=[V(:,1:5) V(:,37:41)] Z=V(:,[1:2:40]) 3. M=[1:10;11:20;21:30] size(M) N=M(:,1:2) P=M([1 3],[3 7]) Q=M(:,[1:2:10]) NP=N*P NtQ=N'*Q NQ= %Error because both its size is not available for multiple matric 4. x=[pi/6 pi/4 pi/3] y1=sin(x) y2=cos(x) y=y1./y2 5. u=[1;2;3] v=[-5;2;1] w=[-1;-3;7] t=u+3*v-5*w U=norm(u) V=norm(v) W=norm(w) z=dot(u,v); a=z/[U*V] b=acosd(a) 6. a. incr=input('put the value of the incressing temperature') F=0:incr:200; K=(5.*(F+459.67)./9); table=[F;K]; disp('Conversions from Fahrenheit to kelvin') disp('In_F conversion to Kelvin') fprintf('%3.4f %3.4frn',table); b. S=input('put the value of the starting temperature') C=linspace(S,200,25); R=(C+273.15).*1.8; table=[C;R]; disp('Conversions from C to Rekin')
  • 3. 3/3Smee disp('In_C conversion to Rekin') fprintf('%3.4f %3.4frn',table); c. S=input('put the value of the starting temperature') incr=input('put the value of the incressing temperature') C=linspace(S,200,incr); F=1.8.*C+32 table=[C;F]; disp('Conversions from C to F') disp('In_C conversion to F') fprintf('%3.4f %3.4frn',table); 7. Defined Function function x = quadratic(a,b,c) delta = 4*a*c; denom = 2*a; rootdisc = sqrt(b.^2 - delta); % Square root of the discriminant x1 = (-b + rootdisc)./denom; x2 = (-b - rootdisc)./denom; x = [x1 x2]; end Comment Window quadratic(1,7,12) quadratic(1,-4,4) quadratic(1,2,3) 8. function volume=SphereTank(radius,depth) volume= pi*depth.^2*(3.*radius-depth)/3; end Comment Window SphereTank(2,1) SphereTank(5,5) ______________________________________________________________________________________________________________________ 8/13/2017 5:32PM Corrected by Mr.Smee Kaem Chann Tel : +885965235960