Can someone please attempt problem B and C? I am a beginner programer and I am v
ID: 3880425 • Letter: C
Question
Can someone please attempt problem B and C? I am a beginner programer and I am very confused, if you could explain your coding that would be great! I am using MatLab by the way, thanks!
Problem B) Through calculus, it is possible to show that For this problem, we want you to gather empirical evidence for that limit by evaluating the expression for progressively smaller values. Specifically, write a script named 1imits.m that creates a vector called limit by evaluating the expression for values of z in the series 1, . , . Display your results by executing the following commands: 2 4 format long; Problem C) For this problem, we consider the motion of a ball under the force of gravity (we will ignore other factors such as air resistance). Let g 9.8 is the acceleration due to gravity, measured in m/s2.If a ball is thrown vertically with an initial velocity of vo. measured in meters/second), it will remain in the air for , seconds. Its height at time t measured in meters will be 2 Write a script baseball.m that creates a vector named eime with 25 evenly spaced values from 0 to . Then compute another vector named he ight that tracks the corresponding height for each time, using the above formula. Test your program using an initial velocity of 43.81 meters/sccond (the equivalent of a 98 m.p.h. fastball). To produce a two-column display of your results, use the command displ [time', height'1 Lastly, use the max function to find the maximum value of your height vector, and store this in a variable called maxHeight Problem D) For any non-zero real number, we have the identity that1. However, computers do not perform arithmetic with arbitrary precision. Instead, they use a convention known as floating-point representation for storing and manipulating numbers with fixed precision. We can find evidence of this by trying to venty the above mathematical identity. If you perform the test 3 * (1 3) == 1 you will likely see that the equivalence is true with the logical true value displayed as I n matlab Yet if you perform the similar test 49 (1 / 49) 1, the condition is false (with the logical false value displayed as "O in matlab Write a script named floatingError.n that per orms the following experiment. Determine what percentage of the first 100 integers successfully satisfy the identity. when computed in MA'T .AB Count how many integcrs satisfy the identity in a variable called numcorrect, and store the percentage of correct integers in a variable called correctRate.Explanation / Answer
If you post more than 1 question, as per chegg guidelines I have to solve only 1 question.
Problem B)
% set the format output
format long
% declare a symbol
syms x
% create a vector of length 26
% It stores the value of the limits for various value of x
vec = [1 : 26];
for i = 0 : 25
% (e^x -1 )
%lim ----------
% x
%
% x = 1 / 2^i
%
% calculate the limit using limit() function
vec(i + 1) = limit( ( exp( x ) - 1 ) / x , 1 / (2^i) );
end
% display the vector
disp(vec)
Sample Output:
Columns 1 through 3
1.718281828459045 1.297442541400256 1.136101666750966
Columns 4 through 6
1.065187624534611 1.031911342685751 1.015789039971285
Columns 7 through 9
1.007853349547888 1.003916442425341 1.001955670616979
Columns 10 through 12
1.000977198593440 1.000488440234532 1.000244180366281
Columns 13 through 15
1.000122080247214 1.000061037639853 1.000030518199016
Columns 16 through 18
1.000015258944284 1.000007629433336 1.000003814706967
Columns 19 through 21
1.000001907351058 1.000000953674923 1.000000476837310
Columns 22 through 24
1.000000238418617 1.000000119209299 1.000000059604647
Columns 25 through 26
1.000000029802323 1.000000014901161