Repeat the above for all elements in are membering

Assignment Help Civil Engineering
Reference no: EM13529992

For this problem you will write a function that calculates avalue between zero and one for each element in a 512x512 matrix(yes thats 512x512). The call to the function will bebeetle(xmin,ymin,xmax,ymax). The element A(1,1)will use values xmin, ymin for calculations and the elementA(512,512) will use xmax, ymax for calculations. Intermediateelements will use evenly spaced values for x and y between xmin,ymin and xmax, ymax.

At each element location in the matrix you are to do thefollowing:

a. set an iteration counter, and twovariables r and s to zero.

b. Repeat the following whiler*r+s*s<=and number of iterations is less than 255

      i. Replace s withr*r-s*s+xi where xi is the value of x assoxciated witht the currentelement.

     ii. replace s with2*r*s+yi where yi is the value of y associated witht the currentelement. Note that the r used here must be the past value of rbefore it was changed in the previous step.

      iii. Increase the countervariable by 1.

c. Once you have exited the loop you willhave recorded the number of iterations required to haver^2+s^2>4 in the iteration counter. This will be a numberbetween 0 and 255. The number to be stored in the element A(i,j)will be 1-counter_valuee/255 so that the stored value is between 0and 1.

d. repeat the abouve for all elements in aremembering that each element will have a different x, ypair.   

To test your function call it with the following argumentsbeetle(-1.5,-1.0,0.5,1.0). You want to save the result but notprint it. To see if you have done a good job run the followingMATLAB commands on the saved matrix:

>>imagesec(A); colormap(gray); %assumes matrix stored inA

You should see an interesting figure window appear on thescreen and the name of the function may make more sense.

Note: I found that a good way to get the correct x and yvalues is to create an x vector of length 512 with values form xminto xmax using linespace. A y vector can be created in the samemanner.

Reference no: EM13529992

Questions Cloud

Analyze which pipe is morelikely to fail in the modes : Given copper and PVC pipe segments analyze which pipe is morelikely to fail in the modes of Compression, Tension,Shear, Bending, and Buckling. Both pieces are the samesize.
Determinethe required diameter of the pin at joint b : A simple truss with joint detail is shown at the left. determinethe required diameter of the pin at joint B if a factor of safetyof 1.8 with respect to shear yielding is required, and the pn is tobe made of steel having shering stress of 145 MPa
Find the changes in the energy of air in jouls : a volumen of 20 cu ft  of air at pressure of 50 psig is heated and expanded and to 30  cu ft  and 40psig  find the changes in the energy of air in jouls.
What other disorders besides vsd can produce a systolic : What other disorders besides VSD can produce a systolicmurmur? How can character of the murmur and pattern of radiation beused to differentiate among these etiologic factors?
Repeat the above for all elements in are membering : For this problem you will write a function that calculates avalue between zero and one for each element in a 512x512 matrix(yes thats 512x512).
What amount of depreciation will you claim for each calender : What amount of depreciation will you claim for each calenderyear during the period 1972-1975?
What is the rolling resistance of the loaded unit : Estimated rolling resistance factor the haul road is 3000 lb/ton.  If the scraper weighs 35,000 lb (empty) and carries 25 loose cubic yards per trip.  What is the rolling resistance of the loaded unit?
What is the rolling resistance : He is concerned about the high rolling resistance of the units in the sand (RR factor 250lb/ton).  What is the rolling resistance?
Find the change in the energy of air in joules : Hummingbird moths are night-flying insects whose behavior and appearance are similar to those of hummingbirds. Explain how thes two organisms demonstrate the concept of convergent evolution.?

Reviews

Write a Review

Civil Engineering Questions & Answers

  Determine the tension in cables ac and ab

The casting has a mass of 3 Mg. Suspended in a vertical position and initially at rest, it is given an upward speed of V mm/s in 0.3s using a crane hook H. Determine the tension in cables AC and AB during this time interval if the acceleration is ..

  Determine hydrostatic force on one side of vertical gate

Determine the hydrostatic force on one side of a vertical clrcular gate of diameter 1.5m when its centre is immersed at a depth of 6m neto-w tne free surface of water in a reservoir.

  What are the concentrations of cl- and br-

AGNO3 is added to a solution containing 0.001 mol Cl- amd 0.001 mol Br- per liter. What are the concentrations of Cl- and Br- remaining when AgCl just begins to precipitate?

  Describe the changes in phases and its structure

Consider a steel (iron) with 0.2 wt% C. Describe the changes in phases and its structure as it is heated under equilibrium conditions to 850 (deg C).

  How much will be the contribution in the funds in 20 years

You are paying into a mututal fund that earns 6% compound interest. If you are making an annual contribution of $10000, how much will be in the funds in 20 years What if the fund makes 10% What if it loses 5% per year

  Determine what is the percentage yield of the reaction

The combustion of 52.8g of butane produces 104.0g of CO2. what is the percentage yield of the reaction

  Find speed and direction of each section relative to earth

A two stage rocket with a total mass of 925kg is traveling at a speed of 6.6 10^3 m/s away from the earth . A predesigned explosion separates into two sections of equal mass that move with a speed of 2800m/s relative to each

  Determine what is the water wettability index for the core

A cylindrical core, completely saturated with oil up to immobile water saturation, is immersed in water and the measured volume of oil displaced by imbibition of water is 7.5 c.c.

  When finding the projection of p onto q what to do with 15n

Force P is directed from point A(5,10,3) towards point B(1,-2,5) and has a magnitude of 15N. Vector Q=6i+2j-5k. When finding the projection of P onto Q what do you do with the 15N

  What are the bearings of the sides cd-de-ea and ab

What are the bearings of the sides CD,DE,EA, and AB if the side CB has a bearing S 20° 44' 36" W, point A is westerly of B and interior angles in each apex are as follows: A = 95° 14' 23"; E=81° 16' 54"

  What is the concentration of mlvss in the activated sludge

What is the concentration of MLVSS in the activated sludge (mg L-1)

  What average force was exerted on the ball

After falling from rest from a height of 32 m, a 0.45 kg ball rebounds upward, reaching a height of 22 m. If the contact between ball and ground lasted 1.5 ms, what average force was exerted on the ball?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd