Question
How to solve by using Matlab?(loops)
Use loops to generate a fully formatted plot of the following piecewise functions on the given domain with three different co


Use loops to generate a fully formatted plot of the following piecewise functions on the given domain with three different co
Use loops to generate a fully formatted plot of the following piecewise functions on the given domain with three different colors. If the piece is a single point, use a different marker to mark the point. Part A should be on one plot and Part B should be on a separate plot. 1. Part A: p(x)3-3 3 Ks2 (x-3)2 x >2 Part B: n-2 x>2
Use loops to generate a fully formatted plot of the following piecewise functions on the given domain with three different colors. If the piece is a single point, use a different marker to mark the point. Part A should be on one plot and Part B should be on a separate plot. 1. Part A: 3/x xs-3 (x -3)2 x>2 Part B: n+4 x -2 Inn-2 2, A miner is paid according to his hourly wage up to 40 hours, and 50% more for overtime. (So, for each hour over 40 he is paid "time and a half") Write a program in a script file that calculates the pay to a worker. The program needs to ask the user to enter the number of hours and the hourly wage. The program then needs to display the pay using 'fprintf You have worked XXX hours this week. Your pay will be XXXX XX dollars
0 0
Add a comment Improve this question Transcribed image text
Answer #1

`Hey,

Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries

1)

clc
clear all
close all
x1=-5:0.01:-3;
x2=-3:0.01:2;
x3=2:0.01:5;
y1=3./x1;
y2=3.^x2-3;
y3=(x3-3).^2;
plot(x1,y1,x2,y2,x3,y3);

clc
clear all
close all
n1=-5:0.01:-2;
n2=-2;
n3=-2:0.01:5;
y1=2*n1+4;
y2=abs(n2);
y3=n3-2;
plot(n1,y1,n2,y2,'oy',n3,y3)

Note: Brother according to HOMEWORKLIB RULES we are only allowed to answer first part if there are many. So, I request you to post other part as separate posts.

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
Use loops to generate a fully formatted plot of the following piecewise functions on the given do...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a C++ console application that uses functions to calculate an employee’s salary.

    Write a C++ console application that uses functions to calculate an employee’s salary.PART 1: Create a void function to print a menu asking the user to choose from the following options:1 - Annual salary2 - Monthly salary3 - Daily rate of pay4 – ExitThe void function only prints the menu. Format your cout statement to include the menu as displayed above.If the chosen option is 1- Annual Salary, ask the user for the number of hours they work perweek and...

  • Program 3. Decisions Due: Friday, February 7 by 11:59 PM Overview For this program, design a...

    Program 3. Decisions Due: Friday, February 7 by 11:59 PM Overview For this program, design a wage calculator for a single user. The program will use the user's number of hours worked and their hourly wage to calculate: Gross Pay Deduction Net Pay The Gross Pay is the amount that the user is paid before any deduction is applied. The pay amount is based upon the number of hours worked. If 40 hours or less were worked, the gross pay...

  • Now use MATLAB to generate and plot 15seconds of this signal in the time-domain.Use the fft()...

    Now use MATLAB to generate and plot 15seconds of this signal in the time-domain.Use the fft() function to find the fourier transform of this signal and plot its magnitude spectrum School of Engineering Task 3 - The Fourier Transform: Scaling property Exercise: Let's take a look now at using the Fourier transform on aperiodic signals. Consider the real exponential signal from the discharging capacitor in tas 3 of laboratory 1 which was found to be: You(t)=e"u(t) Begin by calculating manually...

  • Use MATLAB to generate code for this 4.Given the following functions: (1)  f1 (x, y) = cos...

    Use MATLAB to generate code for this 4.Given the following functions: (1)  f1 (x, y) = cos (3 x); (2) f2 (x, y) = cos (5 y); (3) f3 (x, y) = cos (3 x) cos (5 y); Please plot 3D plots/images for each of the functions. Please show your steps/ derivations to explain why you obtain those plots/figures.

  • C++ Read and do as instructed on please (C++Program *** use only condition statements, loops, functions,...

    C++ Read and do as instructed on please (C++Program *** use only condition statements, loops, functions, files, and arrays. Do NOT use material such as classes. Make sure to add comments** You are to write an ATM Program. The ATM should allow the user to do the following: 1. Create account 2. Log in 3. Exit When they press 1, they are asked for first name (capital first letter). Then it should ask for password. The computer should give the...

  • 2. Consider interpolating the data (x0,yo), . . . , (x64%) given by Xi | 0.1...

    2. Consider interpolating the data (x0,yo), . . . , (x64%) given by Xi | 0.1 | 0.15 | 0.2 | 0.3 | 0.35 | 0.5 | 0.75 yi 4.0 1.0 1.22.12.02.52.5 For all tasks below, please submit your MATLAB code and your plots. You can write all code in a single (a) Using MATLAB, plot the interpolating (6th degree) polynomial given these data on the domain .m-file [0.1,0.75] using the polyfit and polyval commands. To learn how to use...

  • In C++ Please please help.. Assignment 5 - Payroll Version 1.0 In this assignment you must create and use a struct to hold the general employee information for one employee. Ideally, you should use an...

    In C++ Please please help.. Assignment 5 - Payroll Version 1.0 In this assignment you must create and use a struct to hold the general employee information for one employee. Ideally, you should use an array of structs to hold the employee information for all employees. If you choose to declare a separate struct for each employee, I will not deduct any points. However, I strongly recommend that you use an array of structs. Be sure to read through Chapter...

  • solve part B Note: Do not use MATLAB (or other programming languages) build-in functions for regression....

    solve part B Note: Do not use MATLAB (or other programming languages) build-in functions for regression. (a) Write a MATLAB (or other programming languages) function that accepts n values of xi and Yi, perform Linear Regression and returns values of rand, the model parameters ao and a. (6) Write another MATLAB (or other programming languages) function that accepts n values of X, and y(provided as arrays), checks for Linear, Power (y = axBx) and Saturation growth- rate (y = a*)...

  • Problem 1 MATLAB A Taylor series is a series expansion of a function f()about a given point a. For one-dimensional real...

    Problem 1 MATLAB A Taylor series is a series expansion of a function f()about a given point a. For one-dimensional real-valued functions, the general formula for a Taylor series is given as ia) (a) (z- a) (z- a)2 + £(a (r- a) + + -a + f(x)(a) (1) A special case of the Taylor series (known as the Maclaurin series) exists when a- 0. The Maclaurin series expansions for four commonly used functions in science and engineering are: sin(x) (-1)"...

  • Write, save, and run a Python program that will do the following when run: Let’s consider...

    Write, save, and run a Python program that will do the following when run: Let’s consider the following assignment: a = 1 * 2 + 38 / 8 You want to change the precedence of the operators so that the addition operations are executed first. How would you re-write the assignment? Write a print statement to show the output. Let’s consider the following assignments: x = 'z' y= ['x', 'z', 'q'] Now, apparently x is a member of y. Write...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT