1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ser-zykov [4K]
3 years ago
8

Find the root using bisection method with initials 1 and 2 for function 0.005(e^(2x))cos(x) in matlab and error 1e-10?

Computers and Technology
1 answer:
frutty [35]3 years ago
5 0

Answer:

The root is:

c=1.5708

Explanation:

Use this script in Matlab:

-------------------------------------------------------------------------------------

function  [c, err, yc] = bisect (f, a, b, delta)

% f the function introduce as n anonymous function

%       - a y b are the initial and the final value respectively

%       - delta is the tolerance or error.

%           - c is the root

%       - yc = f(c)

%        - err is the stimated error for  c

ya = feval(f, a);

yb = feval(f, b);

if  ya*yb > 0, return, end

max1 = 1 + round((log(b-a) - log(delta)) / log(2));

for  k = 1:max1

c = (a + b) / 2;

yc = feval(f, c);

if  yc == 0

 a = c;

 b = c;

elseif  yb*yc > 0

 b = c;

 yb = yc;

else

 a = c;

 ya = yc;

end

if  b-a < delta, break, end

end

c = (a + b) / 2;

err = abs(b - a);

yc = feval(f, c);

-------------------------------------------------------------------------------------

Enter the function in matlab like this:

f= @(x) 0.005*(exp(2*x)*cos(x))

You should get this result:

f =

 function_handle with value:

   @(x)0.005*(exp(2*x)*cos(x))

Now run the code like this:

[c, err, yc] = bisect (f, 1, 2, 1e-10)

You should get this result:

c =

   1.5708

err =

  5.8208e-11

yc =

 -3.0708e-12

In addition, you can use the plot function to verify your results:

fplot(f,[1,2])

grid on

You might be interested in
Why are many otherwise safety-conscious people victims of Internet crime?
kkurt [141]
Because <span>safety-conscious people don't install virus protectors. Hope this helps.</span>
5 0
3 years ago
Select the correct answer. Linda has written a program that works well on various operating systems, but she needs to increase t
FinnZ [79.3K]
The best answer in this case to improve readability of the program is for Linda to improve the structure (Answer C). Code structure in a program can help convey logic and make the code much more readable to the user. This can include things like using tabs and spacing more effectively, and adding functions that can be called instead of repeating the same lines of code in order to repeat a certain process.
8 0
3 years ago
Assume that printStars is a function that takes one argument and returns no value. It prints a line of N stars (followed by a ne
trasher [3.6K]

Answer:

printStars(35);

Explanation:

public class Question {

   public static void main(String args[]) {

     printStars(35);

   }

   public static void printStars(int numberOfStars){

       for(int i = 1; i <= numberOfStars; i++){

           System.out.print("*");

       }

       System.out.print("\n");

   }

}

7 0
3 years ago
Encryption relies on the use of _________to ensure that information is readable only by the intended recipient.
stich3 [128]

Answer:

Encryption Keys

Explanation:

In order to make sure only the intended recipient receives the information, encryption keys rely on a unique pattern, just like your house key, except instead of grooves and ridges encryption keys use numbers and letters.

4 0
3 years ago
Multiple Choice
anygoal [31]

Answer:

cyptographically

Explanation:

Did this question and got it right. Good luck!

6 0
2 years ago
Other questions:
  • You would like to arrange the records alphabetically. You should _____.
    7·2 answers
  • Documents on the web stored on web servers are known as web _____.
    6·1 answer
  • What is the difference between an embedded image and an attached image
    7·2 answers
  • What default length is used for the ospf dead interval?
    14·1 answer
  • What is the output of the following program when the method is called with 4?
    11·1 answer
  • Design a class named Person and its two subclasses named Student and Employee. Make Faculty and Staff subclasses of Employee. A
    13·1 answer
  • After Alexandra installed new software, she set it up to perform in a certain way. She is _____. changing the peripherals linkin
    10·1 answer
  • Ema Company for business .
    14·1 answer
  • Make variables to represent the length and width of a rectangle, called length and width, respectively. You should set length to
    7·1 answer
  • Which insert image option allows a user to compile, modify, and add captions to images?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!