SlideShare une entreprise Scribd logo
1  sur  2
Again I need some help writing them!
1. In this problem you are asked to develop a matlab function that will calculate the velocity of a
ball when it hits the ground, if the ball is dropped from a height "h" above the ground.
You should have the following function format:
[Velocity] = Ball_Drop(Height)
2.
recreate a function that takes any length vector x of values, eg:
x = [1 1.3 2 2.3 4]
and calculate the average value and product of these vector values. You may not use the built-in
"average" or "product" functions in matlab.
The function should have the following input/output variables and should be saved as
getAverageProduct.m:
[averageVal, product] = getAverageProduct(x)
Solution
The matlab codes are
1. function velocity = Ball_Drop(height)
g = 9.8;
velocity = sqrt(2*g*height);
end
2.
function [averageVal,product] = getAverageProduct(x)
product = 1;
n = size(x,2);
averageVal = sum(x)/n;
for i=1:n
product = product*x(i);
end
end

Contenu connexe

Similaire à Calculate velocity and average product from vectors

Similaire à Calculate velocity and average product from vectors (20)

Visualbasic tutorial
Visualbasic tutorialVisualbasic tutorial
Visualbasic tutorial
 
Matlab ch1 intro
Matlab ch1 introMatlab ch1 intro
Matlab ch1 intro
 
Matlab functions
Matlab functionsMatlab functions
Matlab functions
 
Computer Graphics in Java and Scala - Part 1b
Computer Graphics in Java and Scala - Part 1bComputer Graphics in Java and Scala - Part 1b
Computer Graphics in Java and Scala - Part 1b
 
Xgboost
XgboostXgboost
Xgboost
 
ITT 2014 - Chris Eidhof - Practical Concurrent Programming
ITT 2014 - Chris Eidhof - Practical Concurrent ProgrammingITT 2014 - Chris Eidhof - Practical Concurrent Programming
ITT 2014 - Chris Eidhof - Practical Concurrent Programming
 
MATLAB-Introd.ppt
MATLAB-Introd.pptMATLAB-Introd.ppt
MATLAB-Introd.ppt
 
Matlab 1
Matlab 1Matlab 1
Matlab 1
 
Mmc manual
Mmc manualMmc manual
Mmc manual
 
Joy of scala
Joy of scalaJoy of scala
Joy of scala
 
Tutorial2
Tutorial2Tutorial2
Tutorial2
 
Build Widgets
Build WidgetsBuild Widgets
Build Widgets
 
Well
WellWell
Well
 
Matlab booklet
Matlab bookletMatlab booklet
Matlab booklet
 
Feature Extraction
Feature ExtractionFeature Extraction
Feature Extraction
 
Image processing
Image processingImage processing
Image processing
 
CPP Homework Help
CPP Homework HelpCPP Homework Help
CPP Homework Help
 
Learn a language : LISP
Learn a language : LISPLearn a language : LISP
Learn a language : LISP
 
Advanced JavaScript
Advanced JavaScript Advanced JavaScript
Advanced JavaScript
 
Matlab1
Matlab1Matlab1
Matlab1
 

Plus de wviola

Alice intends to send a secure message to Bob- (1) What are the threat.docx
Alice intends to send a secure message to Bob- (1) What are the threat.docxAlice intends to send a secure message to Bob- (1) What are the threat.docx
Alice intends to send a secure message to Bob- (1) What are the threat.docxwviola
 
Add a function prototype for the function sumNum- # include using nam.docx
Add a function prototype for the function sumNum- # include  using nam.docxAdd a function prototype for the function sumNum- # include  using nam.docx
Add a function prototype for the function sumNum- # include using nam.docxwviola
 
Add a new check on the emp table to make sure that any new employee in.docx
Add a new check on the emp table to make sure that any new employee in.docxAdd a new check on the emp table to make sure that any new employee in.docx
Add a new check on the emp table to make sure that any new employee in.docxwviola
 
Adding elements to an Array- Given the following simple List class tha.docx
Adding elements to an Array- Given the following simple List class tha.docxAdding elements to an Array- Given the following simple List class tha.docx
Adding elements to an Array- Given the following simple List class tha.docxwviola
 
Ad by DealsFactor - Close Menlo Company Contribution Income.docx
Ad by DealsFactor - Close           Menlo Company Contribution Income.docxAd by DealsFactor - Close           Menlo Company Contribution Income.docx
Ad by DealsFactor - Close Menlo Company Contribution Income.docxwviola
 
Action Center activation Administrative Tools Aero applets Computer Co (2).docx
Action Center activation Administrative Tools Aero applets Computer Co (2).docxAction Center activation Administrative Tools Aero applets Computer Co (2).docx
Action Center activation Administrative Tools Aero applets Computer Co (2).docxwviola
 
Acids Bases Taste Taste pH greater than pH less tharn Acids effect ind.docx
Acids Bases Taste Taste pH greater than pH less tharn Acids effect ind.docxAcids Bases Taste Taste pH greater than pH less tharn Acids effect ind.docx
Acids Bases Taste Taste pH greater than pH less tharn Acids effect ind.docxwviola
 
Action Center activation Administrative Tools Aero applets Computer Co.docx
Action Center activation Administrative Tools Aero applets Computer Co.docxAction Center activation Administrative Tools Aero applets Computer Co.docx
Action Center activation Administrative Tools Aero applets Computer Co.docxwviola
 
Action Center activation Administrative Tools Aero applets Computer Co (1).docx
Action Center activation Administrative Tools Aero applets Computer Co (1).docxAction Center activation Administrative Tools Aero applets Computer Co (1).docx
Action Center activation Administrative Tools Aero applets Computer Co (1).docxwviola
 
Acid lonization Constants (K-) for Some Monoprotic Weak Acids at 25 ec.docx
Acid lonization Constants (K-) for Some Monoprotic Weak Acids at 25 ec.docxAcid lonization Constants (K-) for Some Monoprotic Weak Acids at 25 ec.docx
Acid lonization Constants (K-) for Some Monoprotic Weak Acids at 25 ec.docxwviola
 
AC 556 Accounting for Governmental & Nonprofit Entities Chapter 6Solut.docx
AC 556 Accounting for Governmental & Nonprofit Entities Chapter 6Solut.docxAC 556 Accounting for Governmental & Nonprofit Entities Chapter 6Solut.docx
AC 556 Accounting for Governmental & Nonprofit Entities Chapter 6Solut.docxwviola
 
Accounting Which of the following is true of a corporation- OA- The st.docx
Accounting Which of the following is true of a corporation- OA- The st.docxAccounting Which of the following is true of a corporation- OA- The st.docx
Accounting Which of the following is true of a corporation- OA- The st.docxwviola
 
AC 556 Accounting for Governmental & Nonprofit Entities Chapter 7Solut.docx
AC 556 Accounting for Governmental & Nonprofit Entities Chapter 7Solut.docxAC 556 Accounting for Governmental & Nonprofit Entities Chapter 7Solut.docx
AC 556 Accounting for Governmental & Nonprofit Entities Chapter 7Solut.docxwviola
 
advantages and disadvantages of using centralized network management v.docx
advantages and disadvantages of using centralized network management v.docxadvantages and disadvantages of using centralized network management v.docx
advantages and disadvantages of using centralized network management v.docxwviola
 
Advantages & Disadvantages of Server Applications in 150+ wordsSolutio.docx
Advantages & Disadvantages of Server Applications in 150+ wordsSolutio.docxAdvantages & Disadvantages of Server Applications in 150+ wordsSolutio.docx
Advantages & Disadvantages of Server Applications in 150+ wordsSolutio.docxwviola
 
Does any one have a paper on human resource practices in countries bes.docx
Does any one have a paper on human resource practices in countries bes.docxDoes any one have a paper on human resource practices in countries bes.docx
Does any one have a paper on human resource practices in countries bes.docxwviola
 
Do you think Facebook should operate in China even if it means complyi.docx
Do you think Facebook should operate in China even if it means complyi.docxDo you think Facebook should operate in China even if it means complyi.docx
Do you think Facebook should operate in China even if it means complyi.docxwviola
 
Do you think contingent gains should be disclosed in the financial sta (1).docx
Do you think contingent gains should be disclosed in the financial sta (1).docxDo you think contingent gains should be disclosed in the financial sta (1).docx
Do you think contingent gains should be disclosed in the financial sta (1).docxwviola
 
Do you think contingent gains should be disclosed in the financial sta.docx
Do you think contingent gains should be disclosed in the financial sta.docxDo you think contingent gains should be disclosed in the financial sta.docx
Do you think contingent gains should be disclosed in the financial sta.docxwviola
 
Do you believe the double taxation of earnings which occurs at the cor.docx
Do you believe the double taxation of earnings which occurs at the cor.docxDo you believe the double taxation of earnings which occurs at the cor.docx
Do you believe the double taxation of earnings which occurs at the cor.docxwviola
 

Plus de wviola (20)

Alice intends to send a secure message to Bob- (1) What are the threat.docx
Alice intends to send a secure message to Bob- (1) What are the threat.docxAlice intends to send a secure message to Bob- (1) What are the threat.docx
Alice intends to send a secure message to Bob- (1) What are the threat.docx
 
Add a function prototype for the function sumNum- # include using nam.docx
Add a function prototype for the function sumNum- # include  using nam.docxAdd a function prototype for the function sumNum- # include  using nam.docx
Add a function prototype for the function sumNum- # include using nam.docx
 
Add a new check on the emp table to make sure that any new employee in.docx
Add a new check on the emp table to make sure that any new employee in.docxAdd a new check on the emp table to make sure that any new employee in.docx
Add a new check on the emp table to make sure that any new employee in.docx
 
Adding elements to an Array- Given the following simple List class tha.docx
Adding elements to an Array- Given the following simple List class tha.docxAdding elements to an Array- Given the following simple List class tha.docx
Adding elements to an Array- Given the following simple List class tha.docx
 
Ad by DealsFactor - Close Menlo Company Contribution Income.docx
Ad by DealsFactor - Close           Menlo Company Contribution Income.docxAd by DealsFactor - Close           Menlo Company Contribution Income.docx
Ad by DealsFactor - Close Menlo Company Contribution Income.docx
 
Action Center activation Administrative Tools Aero applets Computer Co (2).docx
Action Center activation Administrative Tools Aero applets Computer Co (2).docxAction Center activation Administrative Tools Aero applets Computer Co (2).docx
Action Center activation Administrative Tools Aero applets Computer Co (2).docx
 
Acids Bases Taste Taste pH greater than pH less tharn Acids effect ind.docx
Acids Bases Taste Taste pH greater than pH less tharn Acids effect ind.docxAcids Bases Taste Taste pH greater than pH less tharn Acids effect ind.docx
Acids Bases Taste Taste pH greater than pH less tharn Acids effect ind.docx
 
Action Center activation Administrative Tools Aero applets Computer Co.docx
Action Center activation Administrative Tools Aero applets Computer Co.docxAction Center activation Administrative Tools Aero applets Computer Co.docx
Action Center activation Administrative Tools Aero applets Computer Co.docx
 
Action Center activation Administrative Tools Aero applets Computer Co (1).docx
Action Center activation Administrative Tools Aero applets Computer Co (1).docxAction Center activation Administrative Tools Aero applets Computer Co (1).docx
Action Center activation Administrative Tools Aero applets Computer Co (1).docx
 
Acid lonization Constants (K-) for Some Monoprotic Weak Acids at 25 ec.docx
Acid lonization Constants (K-) for Some Monoprotic Weak Acids at 25 ec.docxAcid lonization Constants (K-) for Some Monoprotic Weak Acids at 25 ec.docx
Acid lonization Constants (K-) for Some Monoprotic Weak Acids at 25 ec.docx
 
AC 556 Accounting for Governmental & Nonprofit Entities Chapter 6Solut.docx
AC 556 Accounting for Governmental & Nonprofit Entities Chapter 6Solut.docxAC 556 Accounting for Governmental & Nonprofit Entities Chapter 6Solut.docx
AC 556 Accounting for Governmental & Nonprofit Entities Chapter 6Solut.docx
 
Accounting Which of the following is true of a corporation- OA- The st.docx
Accounting Which of the following is true of a corporation- OA- The st.docxAccounting Which of the following is true of a corporation- OA- The st.docx
Accounting Which of the following is true of a corporation- OA- The st.docx
 
AC 556 Accounting for Governmental & Nonprofit Entities Chapter 7Solut.docx
AC 556 Accounting for Governmental & Nonprofit Entities Chapter 7Solut.docxAC 556 Accounting for Governmental & Nonprofit Entities Chapter 7Solut.docx
AC 556 Accounting for Governmental & Nonprofit Entities Chapter 7Solut.docx
 
advantages and disadvantages of using centralized network management v.docx
advantages and disadvantages of using centralized network management v.docxadvantages and disadvantages of using centralized network management v.docx
advantages and disadvantages of using centralized network management v.docx
 
Advantages & Disadvantages of Server Applications in 150+ wordsSolutio.docx
Advantages & Disadvantages of Server Applications in 150+ wordsSolutio.docxAdvantages & Disadvantages of Server Applications in 150+ wordsSolutio.docx
Advantages & Disadvantages of Server Applications in 150+ wordsSolutio.docx
 
Does any one have a paper on human resource practices in countries bes.docx
Does any one have a paper on human resource practices in countries bes.docxDoes any one have a paper on human resource practices in countries bes.docx
Does any one have a paper on human resource practices in countries bes.docx
 
Do you think Facebook should operate in China even if it means complyi.docx
Do you think Facebook should operate in China even if it means complyi.docxDo you think Facebook should operate in China even if it means complyi.docx
Do you think Facebook should operate in China even if it means complyi.docx
 
Do you think contingent gains should be disclosed in the financial sta (1).docx
Do you think contingent gains should be disclosed in the financial sta (1).docxDo you think contingent gains should be disclosed in the financial sta (1).docx
Do you think contingent gains should be disclosed in the financial sta (1).docx
 
Do you think contingent gains should be disclosed in the financial sta.docx
Do you think contingent gains should be disclosed in the financial sta.docxDo you think contingent gains should be disclosed in the financial sta.docx
Do you think contingent gains should be disclosed in the financial sta.docx
 
Do you believe the double taxation of earnings which occurs at the cor.docx
Do you believe the double taxation of earnings which occurs at the cor.docxDo you believe the double taxation of earnings which occurs at the cor.docx
Do you believe the double taxation of earnings which occurs at the cor.docx
 

Dernier

call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 

Dernier (20)

call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
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
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 

Calculate velocity and average product from vectors

  • 1. Again I need some help writing them! 1. In this problem you are asked to develop a matlab function that will calculate the velocity of a ball when it hits the ground, if the ball is dropped from a height "h" above the ground. You should have the following function format: [Velocity] = Ball_Drop(Height) 2. recreate a function that takes any length vector x of values, eg: x = [1 1.3 2 2.3 4] and calculate the average value and product of these vector values. You may not use the built-in "average" or "product" functions in matlab. The function should have the following input/output variables and should be saved as getAverageProduct.m: [averageVal, product] = getAverageProduct(x) Solution The matlab codes are 1. function velocity = Ball_Drop(height) g = 9.8; velocity = sqrt(2*g*height); end 2. function [averageVal,product] = getAverageProduct(x) product = 1;
  • 2. n = size(x,2); averageVal = sum(x)/n; for i=1:n product = product*x(i); end end