Question

Please help with this MATLAB problem! I'm writing in MATLAB_R2018b if that makes a difference:)

7. Write a Matlab function (HW07 07.m) that takes 4 arguments and returns two arrays. The arguments are the Xc and yc coordin

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

clear all
clc
[x,y]=HW07_07(2,3,4,100);
plot(x,y);
grid on;
axis equal;
function [x,y]=HW07_07(xc,yc,r,n)
th=linspace(0,2*pi,n);
x=xc+r*cos(th);
y=yc+r*sin(th);
end

Figure File Edit View nsert Tools Desktop Window Help -3 -1 O Type here to search ENG 804 AM IN 04 01/19

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
Please help with this MATLAB problem! I'm writing in MATLAB_R2018b if that makes a difference:) 7....
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
  • Please use matlab cars. Answer: Function file; Command Window: 5.4 Write a user-defined function that plots...

    Please use matlab cars. Answer: Function file; Command Window: 5.4 Write a user-defined function that plots a circle given the coordinates of the center and the radius. For the function name and arguments use circleplot(x,y,R). The input arguments are the and y coordinates of the center and the radius. Use linspace to generte the angle from 0 to π with 100 points. (Hint: the circle equation: x+Rcos and yy-yRsin 0.) This function has no output arguments. Plot the circle using...

  • Matlab Matlab Matlab Matlab, Please solve this problem Problem 4 : Runge's phenomenon For this proble,...

    Matlab Matlab Matlab Matlab, Please solve this problem Problem 4 : Runge's phenomenon For this proble, you wil interpolate the function h(x) = tanh(10x) in I [a, b, through n datapoints (xi, hx with equidistant nodes for several values of n, and observe the behavior of the interpolating polynomial as n increases. You should use the pair of functions polyfit and polyval In your prob40: (a) Interpolate the function tanh(10x) in [-1,1] using a uniform grid of n nodes, where...

  • This uses MATLAB code with plotting HW19: Plotting with plot () Due 11:59 pm Monday 1....

    This uses MATLAB code with plotting HW19: Plotting with plot () Due 11:59 pm Monday 1. (10 pts) Write a script that will produce a sine curve and a cosine curve in the same plot, 0 as shown to the right. 06 0.4 0.2 To have two sets of data in one plot, you may plot the first one, then with the command hold on", plot the other. Or, you can learn how to plot two lines with just one...

  • 3. (3 points) Write the sequence of MATLAB commands that you would use to produce a...

    3. (3 points) Write the sequence of MATLAB commands that you would use to produce a plot depicting the rotini-like surface defined by: for radii (r) going from 0 to 1 (21 values) and angles (θ) going from-10π to 10π (501 values). Your sequence of commands should define rectangular grids of radii and angles, transform them to cartesian coordinates (x.y), compute z, and plot the result as a solid surface, without gridlines (use shading command), with equally scaled x, y...

  • Need help with this simple MATLAB code. I'm trying to plot a new set of Y...

    Need help with this simple MATLAB code. I'm trying to plot a new set of Y values from input X values. I get an error that says: "not enough input arguments." clear all clc close all Q = 3.44E+18; D = 1.51E-17; t = 7200; x = [1E-6 2E-6 2.5E-6 3E-6 4.32E-6]; y = Q/sqrt((pi*D*t))*exp^(-(x)^2/(4*D*t)) plot(x,y, '*r') xlabel('Depth'), ylabel('Concentration')

  • please solve in matlab 1[35p) Write a user-defined MATLAB function that determines the unit vector in...

    please solve in matlab 1[35p) Write a user-defined MATLAB function that determines the unit vector in the direction of the line that connects two points (A and B) in space. For the func- tion name and arguments, use n = unitvec (A,B). The input to the function are two vectors A and B, each with the Cartesian coordinates of the corre- sponding point. The output is a vector with the components of the unit vector Join the direction from A...

  • Please help me with this MATLAB programming problem! Im coding iin MATLAB2018 if that makes any d...

    Please help me with this MATLAB programming problem! Im coding iin MATLAB2018 if that makes any difference! The first picture is the question i need to answer. The picture below is used as reference to answer the question. The last picture (below) is the into to the problem, and is used as reference. 1. Use Matlab to create the following single plot with three subplots. All titles, gridlines, and axis labels should be as shown. Arc System Response 15 E...

  • please help me with this MATLAB CODE and explain to me what each line does and...

    please help me with this MATLAB CODE and explain to me what each line does and what is used for? leave your comments as words, not as pictures. ..................................................................................................................................................................... clear all; close all; % For a script file, you better start with clear all and close all                        % However, for a fucntion, you better NOT to start                        % with them %% End of cell mode example %% Plot function t = 0:0.1:5; x1 = sin(2*5*t); x2 = cos(3*7*t);...

  • I'm working on the newton's method on matlab, could someone help me and show what two...

    I'm working on the newton's method on matlab, could someone help me and show what two lines are needed to be added in the codes in order to make this function work? function sample_newton(f, xc, tol, max_iter) % sample_newton(f, xc, tol, max_iter) % finds a root of the given function f over the interval [a, b] using Newton-Raphson method % IN: % f - the target function to find a root of % function handle with two outputs, f(x), f'(x)...

  • PLEASE HELP SOLVE WITH MATLAB LANGUGE. Below are hints to the problem. THANKS A LOT!! 2...

    PLEASE HELP SOLVE WITH MATLAB LANGUGE. Below are hints to the problem. THANKS A LOT!! 2 Coriolis Force In a rotating frame-of-reference,the equations of motion of a particle, written in co- ordinates fixed to the frame, have additional terms due to the rotation of the frame itself Consider such a rotating frame, with its origin at the center of rotation.In these coor- dinates, the equations of motion for a point-mass subjected to forces F, and F S m, are F(0...

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