SlideShare ist ein Scribd-Unternehmen logo
1 von 2
Downloaden Sie, um offline zu lesen
Matlab functions:
1)sumOddInts will use a for loop to sum all the odd integers between two parameters called start
and finish, e.g. sumOddInts(5,9) -> 21
2)sumIntSquares will use a while loop to sum the squares of the integers from 1 to finish.
3) sumOddIntSquares will use a for loop to sum the odd squares of integers from start to finish,
i.e. 16 will be skipped but 25 would be added to the sum.
4 ) factorial_recurse will use recursion to compute factorial of n.
5 ) factorial_loop will use ‘ for ’ loop to compute factorial of n
Solution
Multiple Questions : Answering two,
1)
function result = sumOddInts(start,finish)
result = 0;
for i = start:finish
if (mod(i,2) != 0)
result=result+i;
end
end
end
2.
function result = sumIntSquares(finish)
result = 0;
i = 1;
while i <= finish
result=result+i*i;
i = i+1;
end
end

Weitere ähnliche Inhalte

Ähnlich wie Matlab functions- 1)sumOddInts will use a for loop to sum all the odd.docx

Lecture#5 Operators in C++
Lecture#5 Operators in C++Lecture#5 Operators in C++
Lecture#5 Operators in C++NUST Stuff
 
determine the total number of closed pathsin all of its digits combin.pdf
 determine the total number of closed pathsin all of its digits combin.pdf determine the total number of closed pathsin all of its digits combin.pdf
determine the total number of closed pathsin all of its digits combin.pdfrakeshboobna1
 
C++ Course - Lesson 2
C++ Course - Lesson 2C++ Course - Lesson 2
C++ Course - Lesson 2Mohamed Ahmed
 
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
 
(1) collections algorithms
(1) collections algorithms(1) collections algorithms
(1) collections algorithmsNico Ludwig
 
Bt0080 fundamentals of algorithms1
Bt0080 fundamentals of algorithms1Bt0080 fundamentals of algorithms1
Bt0080 fundamentals of algorithms1Techglyphs
 
Unit2 algorithmic problem_solving
Unit2 algorithmic problem_solvingUnit2 algorithmic problem_solving
Unit2 algorithmic problem_solvingCapuchino HuiNing
 
B61301007 matlab documentation
B61301007 matlab documentationB61301007 matlab documentation
B61301007 matlab documentationManchireddy Reddy
 
Q1- (5 points) Write a short program that simplifies the following cod.docx
Q1- (5 points) Write a short program that simplifies the following cod.docxQ1- (5 points) Write a short program that simplifies the following cod.docx
Q1- (5 points) Write a short program that simplifies the following cod.docxsngyun4t79
 
Randomised algorithms for travelling salesman problem.docx
Randomised algorithms for travelling salesman problem.docxRandomised algorithms for travelling salesman problem.docx
Randomised algorithms for travelling salesman problem.docxbkbk37
 
Java căn bản - Chapter6
Java căn bản - Chapter6Java căn bản - Chapter6
Java căn bản - Chapter6Vince Vo
 
Workshop03.docx lap trinh C cho người mới bắt đầu
Workshop03.docx  lap trinh C cho người mới bắt đầuWorkshop03.docx  lap trinh C cho người mới bắt đầu
Workshop03.docx lap trinh C cho người mới bắt đầulinhtran111111111111
 

Ähnlich wie Matlab functions- 1)sumOddInts will use a for loop to sum all the odd.docx (20)

Lecture#5 Operators in C++
Lecture#5 Operators in C++Lecture#5 Operators in C++
Lecture#5 Operators in C++
 
determine the total number of closed pathsin all of its digits combin.pdf
 determine the total number of closed pathsin all of its digits combin.pdf determine the total number of closed pathsin all of its digits combin.pdf
determine the total number of closed pathsin all of its digits combin.pdf
 
C++ Course - Lesson 2
C++ Course - Lesson 2C++ Course - Lesson 2
C++ Course - Lesson 2
 
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
 
(1) collections algorithms
(1) collections algorithms(1) collections algorithms
(1) collections algorithms
 
Lecture 7.pptx
Lecture 7.pptxLecture 7.pptx
Lecture 7.pptx
 
C++ control loops
C++ control loopsC++ control loops
C++ control loops
 
Bt0080 fundamentals of algorithms1
Bt0080 fundamentals of algorithms1Bt0080 fundamentals of algorithms1
Bt0080 fundamentals of algorithms1
 
L06
L06L06
L06
 
Unit2 algorithmic problem_solving
Unit2 algorithmic problem_solvingUnit2 algorithmic problem_solving
Unit2 algorithmic problem_solving
 
C# Loops
C# LoopsC# Loops
C# Loops
 
B61301007 matlab documentation
B61301007 matlab documentationB61301007 matlab documentation
B61301007 matlab documentation
 
Appsec obfuscator reloaded
Appsec obfuscator reloadedAppsec obfuscator reloaded
Appsec obfuscator reloaded
 
ICP - Lecture 9
ICP - Lecture 9ICP - Lecture 9
ICP - Lecture 9
 
Q1- (5 points) Write a short program that simplifies the following cod.docx
Q1- (5 points) Write a short program that simplifies the following cod.docxQ1- (5 points) Write a short program that simplifies the following cod.docx
Q1- (5 points) Write a short program that simplifies the following cod.docx
 
Randomised algorithms for travelling salesman problem.docx
Randomised algorithms for travelling salesman problem.docxRandomised algorithms for travelling salesman problem.docx
Randomised algorithms for travelling salesman problem.docx
 
pert_n_cpm.ppt
pert_n_cpm.pptpert_n_cpm.ppt
pert_n_cpm.ppt
 
pert_n_cpm.ppt
pert_n_cpm.pptpert_n_cpm.ppt
pert_n_cpm.ppt
 
Java căn bản - Chapter6
Java căn bản - Chapter6Java căn bản - Chapter6
Java căn bản - Chapter6
 
Workshop03.docx lap trinh C cho người mới bắt đầu
Workshop03.docx  lap trinh C cho người mới bắt đầuWorkshop03.docx  lap trinh C cho người mới bắt đầu
Workshop03.docx lap trinh C cho người mới bắt đầu
 

Mehr von maryi15

Meditorian Banking Statistics The monetary policy of Meditor is determ.docx
Meditorian Banking Statistics The monetary policy of Meditor is determ.docxMeditorian Banking Statistics The monetary policy of Meditor is determ.docx
Meditorian Banking Statistics The monetary policy of Meditor is determ.docxmaryi15
 
Megatronics Corporation- a massive retailer of electronic products- is.docx
Megatronics Corporation- a massive retailer of electronic products- is.docxMegatronics Corporation- a massive retailer of electronic products- is.docx
Megatronics Corporation- a massive retailer of electronic products- is.docxmaryi15
 
Medfin Accounting Company (MAC) specializes in providing accounting an (1).docx
Medfin Accounting Company (MAC) specializes in providing accounting an (1).docxMedfin Accounting Company (MAC) specializes in providing accounting an (1).docx
Medfin Accounting Company (MAC) specializes in providing accounting an (1).docxmaryi15
 
Mechanics of solids Mechanics of solidsSolutionMechanics of solids -.docx
Mechanics of solids   Mechanics of solidsSolutionMechanics of solids -.docxMechanics of solids   Mechanics of solidsSolutionMechanics of solids -.docx
Mechanics of solids Mechanics of solidsSolutionMechanics of solids -.docxmaryi15
 
Medical xrays- with a wavelength of about 10-10m (Negative 10 is a exp (1).docx
Medical xrays- with a wavelength of about 10-10m (Negative 10 is a exp (1).docxMedical xrays- with a wavelength of about 10-10m (Negative 10 is a exp (1).docx
Medical xrays- with a wavelength of about 10-10m (Negative 10 is a exp (1).docxmaryi15
 
Measurement of elevation in grassy areas in photogrammetry requires th.docx
Measurement of elevation in grassy areas in photogrammetry requires th.docxMeasurement of elevation in grassy areas in photogrammetry requires th.docx
Measurement of elevation in grassy areas in photogrammetry requires th.docxmaryi15
 
Measurements of the radioactivity of a certain isotope tell you that t.docx
Measurements of the radioactivity of a certain isotope tell you that t.docxMeasurements of the radioactivity of a certain isotope tell you that t.docx
Measurements of the radioactivity of a certain isotope tell you that t.docxmaryi15
 
Measles has become an epidemic here in Orange County- About 1 in 1000.docx
Measles has become an epidemic here in Orange County- About 1 in 1000.docxMeasles has become an epidemic here in Orange County- About 1 in 1000.docx
Measles has become an epidemic here in Orange County- About 1 in 1000.docxmaryi15
 
May someone please help me solve this problem- Thank you very much I h.docx
May someone please help me solve this problem- Thank you very much I h.docxMay someone please help me solve this problem- Thank you very much I h.docx
May someone please help me solve this problem- Thank you very much I h.docxmaryi15
 
MATLAB- In this exercise- we will work with two string related functio.docx
MATLAB- In this exercise- we will work with two string related functio.docxMATLAB- In this exercise- we will work with two string related functio.docx
MATLAB- In this exercise- we will work with two string related functio.docxmaryi15
 
MC interference and diffraction Due in 3 hours- 37 minutes Evaluate ea.docx
MC interference and diffraction Due in 3 hours- 37 minutes Evaluate ea.docxMC interference and diffraction Due in 3 hours- 37 minutes Evaluate ea.docx
MC interference and diffraction Due in 3 hours- 37 minutes Evaluate ea.docxmaryi15
 
MATLAB- Write a function whose input is a positive integer n- and whos.docx
MATLAB- Write a function whose input is a positive integer n- and whos.docxMATLAB- Write a function whose input is a positive integer n- and whos.docx
MATLAB- Write a function whose input is a positive integer n- and whos.docxmaryi15
 
MBO works by cascading objectives down through the organization- and t.docx
MBO works by cascading objectives down through the organization- and t.docxMBO works by cascading objectives down through the organization- and t.docx
MBO works by cascading objectives down through the organization- and t.docxmaryi15
 
Matthew borrows $250-000 to invest in bonds- During 2013- his interest.docx
Matthew borrows $250-000 to invest in bonds- During 2013- his interest.docxMatthew borrows $250-000 to invest in bonds- During 2013- his interest.docx
Matthew borrows $250-000 to invest in bonds- During 2013- his interest.docxmaryi15
 
Matlab programming- Write a function in Matlab with interface function.docx
Matlab programming- Write a function in Matlab with interface function.docxMatlab programming- Write a function in Matlab with interface function.docx
Matlab programming- Write a function in Matlab with interface function.docxmaryi15
 
matrix norm For all column vectors x of dimension 2 x 1- can we say --.docx
matrix norm For all column vectors x of dimension 2 x 1- can we say --.docxmatrix norm For all column vectors x of dimension 2 x 1- can we say --.docx
matrix norm For all column vectors x of dimension 2 x 1- can we say --.docxmaryi15
 
Materials purchased on account during the month amounted to $180-000-.docx
Materials purchased on account during the month amounted to $180-000-.docxMaterials purchased on account during the month amounted to $180-000-.docx
Materials purchased on account during the month amounted to $180-000-.docxmaryi15
 
Match the following terms with the correct description below- a- oxida.docx
Match the following terms with the correct description below- a- oxida.docxMatch the following terms with the correct description below- a- oxida.docx
Match the following terms with the correct description below- a- oxida.docxmaryi15
 
Match the letter with each item below to indicate how net income is ad.docx
Match the letter with each item below to indicate how net income is ad.docxMatch the letter with each item below to indicate how net income is ad.docx
Match the letter with each item below to indicate how net income is ad.docxmaryi15
 
Match the likelihood of future event with the repotting of the conting.docx
Match the likelihood of future event with the repotting of the conting.docxMatch the likelihood of future event with the repotting of the conting.docx
Match the likelihood of future event with the repotting of the conting.docxmaryi15
 

Mehr von maryi15 (20)

Meditorian Banking Statistics The monetary policy of Meditor is determ.docx
Meditorian Banking Statistics The monetary policy of Meditor is determ.docxMeditorian Banking Statistics The monetary policy of Meditor is determ.docx
Meditorian Banking Statistics The monetary policy of Meditor is determ.docx
 
Megatronics Corporation- a massive retailer of electronic products- is.docx
Megatronics Corporation- a massive retailer of electronic products- is.docxMegatronics Corporation- a massive retailer of electronic products- is.docx
Megatronics Corporation- a massive retailer of electronic products- is.docx
 
Medfin Accounting Company (MAC) specializes in providing accounting an (1).docx
Medfin Accounting Company (MAC) specializes in providing accounting an (1).docxMedfin Accounting Company (MAC) specializes in providing accounting an (1).docx
Medfin Accounting Company (MAC) specializes in providing accounting an (1).docx
 
Mechanics of solids Mechanics of solidsSolutionMechanics of solids -.docx
Mechanics of solids   Mechanics of solidsSolutionMechanics of solids -.docxMechanics of solids   Mechanics of solidsSolutionMechanics of solids -.docx
Mechanics of solids Mechanics of solidsSolutionMechanics of solids -.docx
 
Medical xrays- with a wavelength of about 10-10m (Negative 10 is a exp (1).docx
Medical xrays- with a wavelength of about 10-10m (Negative 10 is a exp (1).docxMedical xrays- with a wavelength of about 10-10m (Negative 10 is a exp (1).docx
Medical xrays- with a wavelength of about 10-10m (Negative 10 is a exp (1).docx
 
Measurement of elevation in grassy areas in photogrammetry requires th.docx
Measurement of elevation in grassy areas in photogrammetry requires th.docxMeasurement of elevation in grassy areas in photogrammetry requires th.docx
Measurement of elevation in grassy areas in photogrammetry requires th.docx
 
Measurements of the radioactivity of a certain isotope tell you that t.docx
Measurements of the radioactivity of a certain isotope tell you that t.docxMeasurements of the radioactivity of a certain isotope tell you that t.docx
Measurements of the radioactivity of a certain isotope tell you that t.docx
 
Measles has become an epidemic here in Orange County- About 1 in 1000.docx
Measles has become an epidemic here in Orange County- About 1 in 1000.docxMeasles has become an epidemic here in Orange County- About 1 in 1000.docx
Measles has become an epidemic here in Orange County- About 1 in 1000.docx
 
May someone please help me solve this problem- Thank you very much I h.docx
May someone please help me solve this problem- Thank you very much I h.docxMay someone please help me solve this problem- Thank you very much I h.docx
May someone please help me solve this problem- Thank you very much I h.docx
 
MATLAB- In this exercise- we will work with two string related functio.docx
MATLAB- In this exercise- we will work with two string related functio.docxMATLAB- In this exercise- we will work with two string related functio.docx
MATLAB- In this exercise- we will work with two string related functio.docx
 
MC interference and diffraction Due in 3 hours- 37 minutes Evaluate ea.docx
MC interference and diffraction Due in 3 hours- 37 minutes Evaluate ea.docxMC interference and diffraction Due in 3 hours- 37 minutes Evaluate ea.docx
MC interference and diffraction Due in 3 hours- 37 minutes Evaluate ea.docx
 
MATLAB- Write a function whose input is a positive integer n- and whos.docx
MATLAB- Write a function whose input is a positive integer n- and whos.docxMATLAB- Write a function whose input is a positive integer n- and whos.docx
MATLAB- Write a function whose input is a positive integer n- and whos.docx
 
MBO works by cascading objectives down through the organization- and t.docx
MBO works by cascading objectives down through the organization- and t.docxMBO works by cascading objectives down through the organization- and t.docx
MBO works by cascading objectives down through the organization- and t.docx
 
Matthew borrows $250-000 to invest in bonds- During 2013- his interest.docx
Matthew borrows $250-000 to invest in bonds- During 2013- his interest.docxMatthew borrows $250-000 to invest in bonds- During 2013- his interest.docx
Matthew borrows $250-000 to invest in bonds- During 2013- his interest.docx
 
Matlab programming- Write a function in Matlab with interface function.docx
Matlab programming- Write a function in Matlab with interface function.docxMatlab programming- Write a function in Matlab with interface function.docx
Matlab programming- Write a function in Matlab with interface function.docx
 
matrix norm For all column vectors x of dimension 2 x 1- can we say --.docx
matrix norm For all column vectors x of dimension 2 x 1- can we say --.docxmatrix norm For all column vectors x of dimension 2 x 1- can we say --.docx
matrix norm For all column vectors x of dimension 2 x 1- can we say --.docx
 
Materials purchased on account during the month amounted to $180-000-.docx
Materials purchased on account during the month amounted to $180-000-.docxMaterials purchased on account during the month amounted to $180-000-.docx
Materials purchased on account during the month amounted to $180-000-.docx
 
Match the following terms with the correct description below- a- oxida.docx
Match the following terms with the correct description below- a- oxida.docxMatch the following terms with the correct description below- a- oxida.docx
Match the following terms with the correct description below- a- oxida.docx
 
Match the letter with each item below to indicate how net income is ad.docx
Match the letter with each item below to indicate how net income is ad.docxMatch the letter with each item below to indicate how net income is ad.docx
Match the letter with each item below to indicate how net income is ad.docx
 
Match the likelihood of future event with the repotting of the conting.docx
Match the likelihood of future event with the repotting of the conting.docxMatch the likelihood of future event with the repotting of the conting.docx
Match the likelihood of future event with the repotting of the conting.docx
 

Kürzlich hochgeladen

General views of Histopathology and step
General views of Histopathology and stepGeneral views of Histopathology and step
General views of Histopathology and stepobaje godwin sunday
 
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdfP4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdfYu Kanazawa / Osaka University
 
In - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxIn - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxAditiChauhan701637
 
Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.EnglishCEIPdeSigeiro
 
M-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxM-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxDr. Santhosh Kumar. N
 
How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17Celine George
 
HED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfHED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfMohonDas
 
Presentation on the Basics of Writing. Writing a Paragraph
Presentation on the Basics of Writing. Writing a ParagraphPresentation on the Basics of Writing. Writing a Paragraph
Presentation on the Basics of Writing. Writing a ParagraphNetziValdelomar1
 
Ultra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxUltra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxDr. Asif Anas
 
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRADUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRATanmoy Mishra
 
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptxSandy Millin
 
Quality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICEQuality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICESayali Powar
 
How to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 SalesHow to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 SalesCeline George
 
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfMaximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfTechSoup
 
Philosophy of Education and Educational Philosophy
Philosophy of Education  and Educational PhilosophyPhilosophy of Education  and Educational Philosophy
Philosophy of Education and Educational PhilosophyShuvankar Madhu
 
How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17Celine George
 
CAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptxCAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptxSaurabhParmar42
 
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...Nguyen Thanh Tu Collection
 
5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...CaraSkikne1
 

Kürzlich hochgeladen (20)

General views of Histopathology and step
General views of Histopathology and stepGeneral views of Histopathology and step
General views of Histopathology and step
 
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdfP4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
 
In - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxIn - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptx
 
Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.
 
M-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxM-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptx
 
How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17
 
HED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfHED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdf
 
Presentation on the Basics of Writing. Writing a Paragraph
Presentation on the Basics of Writing. Writing a ParagraphPresentation on the Basics of Writing. Writing a Paragraph
Presentation on the Basics of Writing. Writing a Paragraph
 
Ultra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxUltra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptx
 
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRADUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
 
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
 
Quality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICEQuality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICE
 
How to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 SalesHow to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 Sales
 
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfMaximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
 
Philosophy of Education and Educational Philosophy
Philosophy of Education  and Educational PhilosophyPhilosophy of Education  and Educational Philosophy
Philosophy of Education and Educational Philosophy
 
How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17
 
Prelims of Kant get Marx 2.0: a general politics quiz
Prelims of Kant get Marx 2.0: a general politics quizPrelims of Kant get Marx 2.0: a general politics quiz
Prelims of Kant get Marx 2.0: a general politics quiz
 
CAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptxCAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptx
 
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
 
5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...
 

Matlab functions- 1)sumOddInts will use a for loop to sum all the odd.docx

  • 1. Matlab functions: 1)sumOddInts will use a for loop to sum all the odd integers between two parameters called start and finish, e.g. sumOddInts(5,9) -> 21 2)sumIntSquares will use a while loop to sum the squares of the integers from 1 to finish. 3) sumOddIntSquares will use a for loop to sum the odd squares of integers from start to finish, i.e. 16 will be skipped but 25 would be added to the sum. 4 ) factorial_recurse will use recursion to compute factorial of n. 5 ) factorial_loop will use ‘ for ’ loop to compute factorial of n Solution Multiple Questions : Answering two, 1) function result = sumOddInts(start,finish) result = 0; for i = start:finish if (mod(i,2) != 0) result=result+i; end end end 2. function result = sumIntSquares(finish) result = 0; i = 1; while i <= finish result=result+i*i;