CS计算机代考程序代写 matlab [Content_Types].xml

[Content_Types].xml

_rels/.rels

matlab/_rels/document.xml.rels

matlab/document.xml

matlab/output.xml

media/image1.png

metadata/coreProperties.xml

metadata/mwcoreProperties.xml

metadata/mwcorePropertiesExtension.xml

metadata/mwcorePropertiesReleaseInfo.xml

MATLAB Programming In this livescript, you will learn how to Use for loops in MATLAB to make repeated computations until a specified condition is met. A “for” loop is used if you want to execute code statements a fixed number of times. A for loop usually looks something like for n=1:N a=a+2 end The piece of code above will add the value of 2 to the variable a, N number of times. At the end of the loop, the value of n=N. What value of x does the code below print out? Run the piece of code below and see if you are right x=1
for n=1:5
x=x+1
end The Babylonian method of computing the square root of some value S>0 uses the iterative formula x_{n+1}=\frac{1}{2}\Big(x_{n}+\frac{S}{x_{n}}\Big). So x_{\infty}\rightarrow \sqrt{S} . Starting with x_1=1 and S=2 , complete the table below using the equation for the Babylonian method and a calculator Check that x_5 should be very close to \sqrt{2}\approx 1.4142135623730951 . We will now show how you can use the for loop to compute $x=\sqrt{S}$ using the Babylon method x_{i+1}=\frac{1}{2}\left(x_i+\frac{S}{x_i}\right). The piece of code using the Babylon method to find x for S=2 (using just 3 iterations) is given below S=2
x=1
for i=1:3
x=(1./2.)*(x+S/x)
end
x Check your answer with MATLAB’s \texttt{sqrt()} function. sqrt(2) In many engineering problems, you will need to deal with multi dimensional problems. For example, the air temperature in a room is a function of 3 spatial coordinates, x , y and z and also time, t .

manual code ready 0.4 variable x 1 1 1 1 variable x 2 1 1 3 variable x 3 1 1 3 variable x 4 1 1 3 variable x 5 1 1 3 variable x 6 1 1 3 variable S 2 1 1 5 variable x 1 1 1 6 variable x 1.5000 1 1 8 variable x 1.4167 1 1 8 variable x 1.4142 1 1 8 variable x 1.4142 1 1 10 variable ans 1.4142 1 1 11 true false 0 9 9 0 false true 1 10 12 1 2 3 4 5 true false 2 27 27 6 false false 3 28 28 7 false false 4 29 31 8 9 10 false false 5 32 32 11 false true 6 34 34 12

2020-07-20T05:18:43Z 2021-02-15T02:32:55Z

application/vnd.mathworks.matlab.code MATLAB Code R2020b

9.9.0.1444674 aab05770-9381-4bc2-a41b-21b793d4755c

9.9.0.1538559
R2020b
Update 3
Nov 23 2020
869446053