Numerical Analysis With Matlab2020

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By FUEL DEPT
F
FUEL DEPT
Community Contributor
Quizzes Created: 1 | Total Attempts: 117
| Attempts: 117 | Questions: 20
Please wait...
Question 1 / 20
0 %
0/100
Score 0/100
1. To print a new line in fprintf functions

Explanation

The correct answer is "\n". In the fprintf function, "\n" is used to print a new line. It is a special character that represents the end of a line and causes the cursor to move to the beginning of the next line when printed.

Submit
Please wait...
About This Quiz
Numerical Analysis With Matlab2020 - Quiz

This quiz titled 'Numerical analysis with matlab2020' assesses skills in MATLAB for solving numerical problems, including matrix operations, polynomial equations, and differential equations using methods like Euler's. It is designed for learners to apply mathematical theories and computational techniques.

Personalize your quiz and earn a certificate with your name on it!
2. In Runge-Kutta method  k2= 

Explanation

In the Runge-Kutta method, k2 is calculated by evaluating the derivative of the function at the midpoint of the interval, using the value of k1 divided by 2. This is represented by the equation k2 = hf(xn+h/2, yn+k1/2). This approach helps to improve the accuracy of the approximation by taking into account the average slope over the interval.

Submit
3. To add comments 

Explanation

not-available-via-ai

Submit
4. Function f=new4(x)     f=x.^3-4*x+3;               end Apply the following in commands windows and find the results feval(@new4,[-3  -2 -1 0 ]

Explanation

The given code defines a function called "new4" which takes an input "x" and returns the value of x^3 - 4x + 3. The "feval" function is then used to evaluate the "new4" function for the input values [-3, -2, -1, 0]. The results of these evaluations are -12, 3, 6, and 3 respectively.

Submit
5. What is the function of @

Explanation

The "@" symbol in programming languages, such as in Python, is used to create a handle or reference to a function. It allows you to pass functions as arguments, store them in variables, or return them as values. This is commonly used in scenarios where you want to pass a function as an argument to another function or when you want to store a function in a variable for later use.

Submit
6. We run this commands isnumeric(32) the results is

Explanation

The command "isnumeric(32)" is used to check if the given input, which is 32 in this case, is a numeric value. The result of this command is 1, which means that 32 is indeed a numeric value.

Submit
7. Solve the following equation dy/dx=x^2+y^2 Initial values y(0)=1 x=[0  1] h=0.05 xn= x0+ n h find y(0.4) use Euler method

Explanation

Using the Euler method, we can approximate the value of y(0.4) by iteratively calculating the values of y at each step. Starting with y(0) = 1, we can calculate y(0.05) using the equation dy/dx = x^2 + y^2. Plugging in x = 0 and y = 1, we get dy/dx = 0^2 + 1^2 = 1. Multiplying this by the step size h = 0.05, we get dy = 0.05. Adding this to the initial value of y, we get y(0.05) = 1 + 0.05 = 1.05. We repeat this process for each step until we reach x = 0.4, and the approximate value of y(0.4) using the Euler method is 1.627.

Submit
8. x = linspace (0 ,2*pi ,41);  y = tan( x ); plot (x , y);

Explanation

The given code snippet generates a plot of the tangent function for values of x ranging from 0 to 2*pi. The plot command is used to create the graph. Therefore, the correct answer is Option 4, which indicates that the code will plot the tangent function.

Submit
9. Solve the following equation dy/dx=x^2+y^2 Initial values y(0) =1 , x=[0  1] n=10 xn= x0+ n h find y(0.4) use Euler method

Explanation

Using the Euler method, we can approximate the value of y(0.4) by iteratively calculating the slope at each step and updating the y-value. Starting with the initial value y(0) = 1, we can calculate the slope at x = 0 using the given equation dy/dx = x^2 + y^2. Plugging in x = 0 and y = 1, we get dy/dx = 0^2 + 1^2 = 1.

Using this slope, we can calculate the approximate value of y at x = 0.1 by adding the product of the slope and the step size (h) to the previous value of y. Continuing this process for the given number of steps (n = 10) and using the step size (h = 0.1), we can find the approximate value of y at x = 0.4.

After performing the calculations, the approximate value of y(0.4) is found to be 1.573, which matches the given answer.

Submit
10. Find the results of the following series  E=1+1/2!+1/3!+1/4!+1/5! take x=2:5  5! is equal 5*4*3*2*1

Explanation

The given series is a sum of reciprocals of factorials. The factorial of a number is the product of all positive integers less than or equal to that number. In this case, the factorial of 5 is 5 * 4 * 3 * 2 * 1 = 120.

By substituting x=2:5 into the series, we get:
E = 1 + 1/2! + 1/3! + 1/4! + 1/5!
= 1 + 1/2 + 1/6 + 1/24 + 1/120
= 1 + 0.5 + 0.1667 + 0.0417 + 0.0083
= 1.7167

Therefore, the correct answer is 1.7167.

Submit
11. Express the this function in matlab f(x)=ex +sin(5x)      

Explanation

The correct answer is f=@(x)exp(x)+sin(5*x). This is the correct way to express the given function in MATLAB. The "@" symbol indicates that it is an anonymous function, and the "exp(x)" represents the exponential function and "sin(5*x)" represents the sine function. The plus sign is used to add the two functions together.

Submit
12. X1 + x2 = 2 4x1 + 5x2 = 10

Explanation

The given system of equations can be written in matrix form as Ax = b, where A is the coefficient matrix, x is the variable matrix, and b is the constant matrix. The coefficient matrix A is [[1, 1], [4, 5]], the variable matrix x is [x1, x2], and the constant matrix b is [2, 10]. To find the solution x, we can use matrix algebra and solve for x by multiplying both sides of the equation by the inverse of A. The inverse of A exists because the determinant of A is not zero. The solution x will be [0, 2].

Submit
13. What is function of (;)

Explanation

The semicolon (;) is used as a row separator in certain programming languages or data formats. It is commonly used to separate multiple statements or expressions within a single line of code. In this context, it helps to organize and structure the code by indicating the end of one row or statement and the beginning of the next. By using semicolons, developers can write more concise and readable code, especially when dealing with complex or lengthy statements.

Submit
14. Approximate the area under the curve y=2^x between x=−1 and x=3 using the Trapezoidal Rule with n=4 subintervals. rule Tn=Δx/2[f(x0)+2f(x1)+2f(x2)+2f(x3)+f(xn)].

Explanation

The Trapezoidal Rule is a method used to approximate the area under a curve by dividing the interval into smaller subintervals and approximating each subinterval with a trapezoid. The formula for the Trapezoidal Rule is given as Tn = Δx/2[f(x0) + 2f(x1) + 2f(x2) + 2f(x3) + f(xn)], where Δx is the width of each subinterval and f(xi) represents the value of the function at each subinterval. In this case, the Trapezoidal Rule with n=4 subintervals was used to approximate the area under the curve y=2^x between x=-1 and x=3, resulting in Tn=11.25.

Submit
15. To plot the following  function y = myfunc ( x ) y = 2* x .^2 - 3* x + 1; end  

Explanation

The correct answer is fplot(@myfunc,[-2 2]). This is the correct answer because the fplot function is used to plot a function, and the @myfunc specifies the function to be plotted. The range of x values to be plotted is specified as [-2 2].

Submit
16. [1  0   0 1  1   1 1  2/3    4/9    ] [x0,x1,x2]' [1 0 0.5]' find x1  x2 x3

Explanation

not-available-via-ai

Submit
17. Nsteps=  in Euler method

Explanation

The given expression, (xn-x0)/(h)+1, represents the number of steps in Euler's method. In Euler's method, the number of steps is determined by the difference between the final and initial values (xn-x0), divided by the step size (h), and then adding 1. This is because each step in Euler's method approximates the solution at a specific point, and the total number of steps is determined by dividing the interval between the initial and final values by the step size, and then adding 1 to account for the initial value. Therefore, (xn-x0)/(h)+1 correctly represents the number of steps in Euler's method.

Submit
18. Function f=new(x)    f=x.^3-4*x+3;     end Apply the following in commands windows and find the results fzero(@new,[-3  -2 ]

Explanation

The answer -2.4567 is obtained by applying the fzero function to the function "new" with an initial interval of [-3 -2]. The fzero function is used to find the root of a given function within a specified interval. In this case, the function "new" is a cubic function defined as f(x) = x^3 - 4x + 3. By applying the fzero function, it is determined that the root of this function within the interval [-3 -2] is approximately -2.4567.

Submit
19. What are %4.2f means in fprintf function 

Explanation

The %4.2f in the fprintf function is a format specifier that is used to print a floating-point number with a width of 4 characters and a precision of 2 decimal places. In the given answer, 21.01 is the number that would be printed using this format specifier.

Submit
20. In polynomials find [x1 x2 x3 ]from the following equations X1+x2+x3=6 2x1+x2+x3=7

Explanation

not-available-via-ai

Submit
View My Results

Quiz Review Timeline (Updated): Mar 5, 2025 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 05, 2025
    Quiz Edited by
    ProProfs Editorial Team
  • May 26, 2020
    Quiz Created by
    FUEL DEPT
Cancel
  • All
    All (20)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
To print a new line in fprintf functions
In Runge-Kutta method  k2= 
To add comments 
Function f=new4(x) ...
What is the function of @
We run this commands isnumeric(32) the results is
Solve the following equation ...
X = linspace (0 ,2*pi ,41);  y = tan( x ); plot (x , y);
Solve the following equation dy/dx=x^2+y^2 ...
Find the results of the following series  ...
Express the this function in matlab ...
X1 + x2 = 2 4x1 + 5x2 = 10
What is function of (;)
Approximate the area under the curve y=2^x between x=−1 and x=3...
To plot the following  ...
[1  0   0 ...
Nsteps=  in Euler method
Function f=new(x) ...
What are %4.2f means in fprintf function 
In polynomials find [x1 x2 x3 ]from the following equations ...
Alert!

Advertisement