Question

This should be written in MATLAB.

ICA 2: The Board of Regents has decided that the new hotel outside Kyle Field isnt big enough, so they are going to tear it down and build an even-bigger one. They would like you to model it in MATLAB first. In order to do that, you should follow these instructions. The formula for the height of the building, as a function of x and y is z = 1/(x2 + y2) where x and y both run from -0.75 to 0.75 in steps of 0.05. This function yields the height of the building in meters at locations in x and y. It was pointed out that when x and y are both 0, this equation would yield an infinite height. The Board of Regents didnt see the problem with that, until you pointed out that an infinitely tall building would require an infinite amount of concrete, and would be infinitely expensive. They understand that, and told you to adjust the model so that you didnt divide by zero. It was next pointed out that the new hotel would be in the flight path of Easterwood airport, and the FAA regulations would limit the building to 300 m. Once the Board understood that the FAA was not a football conference inferior to the SEC, they agreed that your model should limit the height to 300 m. Using meshgrid and surf, please generate a figure with a modeled building. You may find the find function useful in your script. The figure should look something like this: a) b) c) d)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

The required MATLAB comment along with necessary comments are given as follows:

clear all
close all
clc

x = [-0.75:0.05:0.75]; % the x-cordinate
y = [-0.75:0.05:0.75]; % y-cordinate
[X,Y] = meshgrid(x,y); % create a mesh of x and y cordinates
for i=1:length(X)
for j=1:length(Y)
x=X(i,j); y=Y(i,j); % pick point x and y from mesh
  
% if x and y are bothe equals to zero, set it to a small non-zero number.
if x==0 && y==0
x=0.0001; y=0.0001; % In case case x and y have been set to 1e-4.
end
  
Z(i,j)=1/(x^2+y^2); % calculate the height given x and y
  
% if height of the building exceed 300 m
if Z(i,j)>300
Z(i,j)=300; % set the height at that point to 300 m
end
end
end

surf(X,Y,Z) % make the surface plot
title('Model for the new Kyle Field Hotel ')
xlabel('Length') % x-axis label
ylabel('Width') % y-axis label
zlabel('Height')

-------------------------------------------------------------- SCREENSHOT OF CODE

main-file.m ×1+ clear all close all clc x = .[-0.75:0.05:0.75); y = .[-0.75:0.05:0.75); (X,Y] = meshgrid (x,y); for i-1:lengt

-------------------------------------------------------------------------SAMPLE OUTPUT

Model for the new Kyle Field Hotel 300 250 200 150 100 50 0.8 0.6 0.4 0.2 0.8 0.6 0.4 -0.2 0.2 0.4 -0.2 0.6 04 Width 0.6 0.8

Add a comment
Know the answer?
Add Answer to:
This should be written in MATLAB. ICA 2: The Board of Regents has decided that the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • This is a matlab HW that I need the code for, if someone could help me figure this out it would b...

    This is a matlab HW that I need the code for, if someone could help me figure this out it would be appreciated. The value of t can be estimated from the following equation: in your script file, estimate the value of π for any number of terms. You must ask the user for the desired number of terms and calculate the absolute error/difference between your calculation and the built-in MATLAB value ofpi. Display your results with the following message...

  • part 2 outdoors. Matt has decided to incorporate the business to limit his legal liability. The...

    part 2 outdoors. Matt has decided to incorporate the business to limit his legal liability. The business began operations April 1, 2019, and will have a May 31 year end. Received $32,000 cash to begin the company in exchange for 16,000 shares of $2 par value common stock April 1 2 Signed a lease for space on the beach and paid $1,200 for the first month's rent. 2 Purchased computer equipment for $2,800. 2 Hired Katie Weekly to help out...

  • Hello I need help with this program. Should programmed in C! Program 2: Sorting with Pointers...

    Hello I need help with this program. Should programmed in C! Program 2: Sorting with Pointers Sometimes we're given an array of data that we need to be able to view in sorted order while leaving the original order unchanged. In such cases we could sort the data set, but then we would lose the information contained in the original order. We need a better solution. One solution might be to create a duplicate of the data set, perhaps make...

  • #2 You are going to add more code to carClass.cpp. 0. Make sure you finished the...

    #2 You are going to add more code to carClass.cpp. 0. Make sure you finished the lab part: goForward, turnRight(), getDirection(), getXO, getY() and get Modelo 1. Preparation: In the last lab, we tested our functions using cl. Comment out that section. Create c2 with any make and model. int main() Car cl("Toyota", "Camry") 77777777777777 lereate c2 here Tested the functions in the last lab cout <<cl.getModel() << endl; Comment out this section cout <<cl.getX() <<"*«<cl.getY() << endl; return 0;...

  • Assignment Predator / Prey Objectives Reading from and writing to text files Implementing mathematical formulas in...

    Assignment Predator / Prey Objectives Reading from and writing to text files Implementing mathematical formulas in C++ Implementing classes Using vectors Using command line arguments Modifying previously written code Tasks For this project, you will implement a simulation for predicting the future populations for a group of animals that we’ll call prey and their predators. Given the rate at which prey births exceed natural deaths, the rate of predation, the rate at which predator deaths exceeds births without a food...

  • In your judgement, and given only the facts described in this case, should the management of...

    In your judgement, and given only the facts described in this case, should the management of Massey energy Company be held morally responsible for the deaths of the 29 miners? Explain in detail. Suppose that nothing more is learned about the explosion other than what is described in this case. Do you think Don Blankership should be held morally responsible for the deaths of the 29 miners? Explain in detail. Given only the facts described in this case, should the...

  • Consider a cylindrical capacitor like that shown in Fig. 24.6. Let d = rb − ra...

    Consider a cylindrical capacitor like that shown in Fig. 24.6. Let d = rb − ra be the spacing between the inner and outer conductors. (a) Let the radii of the two conductors be only slightly different, so that d << ra. Show that the result derived in Example 24.4 (Section 24.1) for the capacitance of a cylindrical capacitor then reduces to Eq. (24.2), the equation for the capacitance of a parallel-plate capacitor, with A being the surface area of...

  • Chapter overview 1. Reasons for international trade Resources reasons Economic reasons Other reasons 2. Difference between...

    Chapter overview 1. Reasons for international trade Resources reasons Economic reasons Other reasons 2. Difference between international trade and domestic trade More complex context More difficult and risky Higher management skills required 3. Basic concept s relating to international trade Visible trade & invisible trade Favorable trade & unfavorable trade General trade system & special trade system Volume of international trade & quantum of international trade Commodity composition of international trade Geographical composition of international trade Degree / ratio of...

  • How can we assess whether a project is a success or a failure? This case presents...

    How can we assess whether a project is a success or a failure? This case presents two phases of a large business transformation project involving the implementation of an ERP system with the aim of creating an integrated company. The case illustrates some of the challenges associated with integration. It also presents the obstacles facing companies that undertake projects involving large information technology projects. Bombardier and Its Environment Joseph-Armand Bombardier was 15 years old when he built his first snowmobile...

  • What an Executive Summary Is An executive summary is a specific type of document that does...

    What an Executive Summary Is An executive summary is a specific type of document that does two things: it summarizes a research article, and it offers recommendations as to how information from the article can be used. Some long reports can contain an executive summary section, as indicated in the Pearson handbook. Write a 2 pahe Executive Summary In business contexts, an executive summary is always written for a specific purpose: to explain the information in the article to a...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT