1. A square-based pyramid has the volume V. If the vertical height is H (the normal...

60.1K

Verified Solution

Question

Mechanical Engineering

1. A square-based pyramid has the volume V. If the verticalheight is H (the normal distance from the square base to thepoint), write a MATLAB function that:

has V and H as input arguments

calculates the length of the side of the square (S)

has S as an output argument

Write MATLAB code that tests the function for the values:

V = 10 m3 and H = 2 m.

V = 2.586×106 m3 and H = 146.6 m (theoriginal dimensions of the Great Pyramid of Giza).

2. Repeat SPIDER 2 Q1, but write a function that accepts a yearas an input argument and determines whether that year is a leapyear. The output should be the variable extra_day, which should be1 if the year is a leap year and 0 otherwise.

You must write a script file that thoroughly tests whether yourfunction works correctly.

Answer & Explanation Solved by verified expert
4.5 Ratings (842 Votes)
Matlab script to test the computation of length of a side of a square for given Volume of pyramid and its height clc test1 V10 H2 SlengthOfSideofSquareVH fprintfnfor volume f Height fLength    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students