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

  Engineering ethics and ethical issue

what is the engineering ethics course where to write about any engineering ethical case and discuss the ethical issue?

  Engineering ethics and concept and cases

what is the engineering ethics case related to civil engineering with reference and discuss all the engineering ethics issues which covered the "Engineering etics concepte and cases?

  Transportation and management

In the construction management, there is a lot of procurement route that are necessary and suitable for the construction industry.

  Supporting Investment Promotion: ERNST & YOUNG

Ernst & young is currently providing support to various sectors. In this regards it was felt that if this report is able to document good practices currently being adopted or planned in ceramic sector.

  Personalized Cancer Therapy-A step forward

Cancer is the uncontrolled growth of abnormal cells in the body resulting in tumours that can be benign or malignant (cancerous cells). A proper treatment is necessary to fight with this serious disease.

  Discuss the different environmental companies

Discuss the different agencies, institutes, centers, different environmental companies that are active in UAE.

  Develop a simple urban constructed wetland design

Develop a simple urban constructed wetland design.

  Evaluate company performance in relation to GRI standards

Evaluate company performance in relation to GRI standards and comment on Stigler's theory.

  Water system design

Determine the corresponding error in the computed discharge

  Hydraulic behaviour in open channel

Describe how test flumes and associated equipment are used to assess and confirm hydraulic behaviour in open channel

  Write a paper on steel sustainability

Write a paper on steel sustainability.

  Writing case study about bridge collapse

Writing case study about bridge collapse

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