Question

In: Computer Science

Create a MATLAB script file to determine the given function is continuous or discontinuous at given...

Create a MATLAB script file to determine the given function is continuous or discontinuous at given interval (points).

Solutions

Expert Solution

`Hey,

Note: If you have any queries related to the answer please do comment. I would be very happy to resolve all your queries.

clc
clear all
close all
format long g
f=@(x) tan(x);
%interval is taken as -1 to 1
x=-5:0.0001:5;
h=1e-10;
for i=1:length(x)
if(~(abs(f(x(i))-f(x(i)+h))<1e-4&abs(f(x(i))==f(x(i)-h))<1e-4))
disp(['Function is discontinuous at x=' num2str(x(i))]);
return;
end
end
disp('It is continuous function')

Kindly revert for any queries

Thanks.


Related Solutions

For the following exercises, consider the graph of the function f and determine where the function is continuous/ discontinuous and differentiable/not differentiable.
For the following exercises, consider the graph of the function f and determine where the function is continuous/ discontinuous and differentiable/not differentiable.
For the following exercises, consider the graph of the function f and determine where the function is continuous/ discontinuous and differentiable/not differentiable.
For the following exercises, consider the graph of the function f and determine where the function is continuous/ discontinuous and differentiable/not differentiable.
how to create a script file on puTTy script pp1.txt
how to create a script file on puTTy script pp1.txt
Using Python create a script called create_notes_drs.py. In the file, define and call a function called...
Using Python create a script called create_notes_drs.py. In the file, define and call a function called main that does the following: Creates a directory called CyberSecurity-Notes in the current working directory Within the CyberSecurity-Notes directory, creates 24 sub-directories (sub-folders), called Week 1, Week 2, Week 3, and so on until up through Week 24 Within each week directory, create 3 sub-directories, called Day 1, Day 2, and Day 3 Bonus Challenge: Add a conditional statement to abort the script if...
Create a bash script file named assessment-script-a that: 1. Accepts any number of file names on...
Create a bash script file named assessment-script-a that: 1. Accepts any number of file names on the command line 2. For each file name provided, delete any line that contains the string: qwe.rty When the changes are completed, the script should display the total number of files scanned, and the total number of files changed. Example Command: assessment-script-a file.a file.b file.c file.d file.e    Example Output: 5 files scanned, 3 files changed 3. Your script should include a series of...
Find the x-value at which f is discontinuous and determine whether f is continuous from the...
Find the x-value at which f is discontinuous and determine whether f is continuous from the right, or from the left, or neither. f(x) = {5 + x^2 if x ≤ 0 6 − x if 0 < x ≤ 6 (x − 6)^2 if x > 6 x = A. continuous from the right B. continuous from the left C. neither
To find a positive root for , write a MATLAB script file that uses Bisection method....
To find a positive root for , write a MATLAB script file that uses Bisection method. Choose any initial value that is needed. Use absolute relative approximate error to be less than 0.01. Your code should report the number of iteration and the value of x.
For the following exercises, determine why the function f is discontinuous at a given point a on the graph. State which condition fails.
For the following exercises, determine why the function f is discontinuous at a given point a on the graph. State which condition fails. f(x) = 25 – x2/x2 – 10x + 25 
Write a Matlab script-file probl1.m to execute the requested commands (as much as possible) in the...
Write a Matlab script-file probl1.m to execute the requested commands (as much as possible) in the exercises below. Increase N a number of times according to N = 4, 8, 16, 32, 64, 128, . . . (1) Determine for each N the (exact) error. (2) Determine for N ≥ 16 also the convergence ratio q(h/2). This script should be based on a function-file trap.m (trapezoidal integration) as follows: function [totarea] = trap(N) format long; a = 0; b =...
Write a MATLAB script file that will give the value of f(x) using method of least...
Write a MATLAB script file that will give the value of f(x) using method of least squares and asks the user to enter values of x, y, n (curve fit), and x for f(x).
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT