Question

ON MATLAB, CREATE THOSE OUTPUTS WITH DIFFERENT VALUES. BE SURE U HAVE TO CHANGE NUMBERS, COLORS,...

ON MATLAB, CREATE THOSE OUTPUTS WITH DIFFERENT VALUES.

BE SURE U HAVE TO CHANGE NUMBERS, COLORS, SHAPES AND LTNE WEIGHTs...

AND SHOW YOUR OUTPUT RESULTS AS WELL...

the code::

% About Graphs

x = 0: pi/40: 4*pi;
figure, plot(x, sin(x))

figure, plot([1 1 2 3 3], [0 2 3 2 0]), axis([0 4 0 4])

% for easy plotting:
figure, ezplot('tan(x)')

% for plotting two graphs on the same axes
% it allows to have independent y-axis labels on the left and the right.
plotyy(x,sin(x), x, 10*cos(x))

% plotting options: style, marker and color
plot(x, sin(x), x, cos(x), 'om--')


% polar plot
x = 0:pi/400:2*pi;
polar(x, sin(4*x)),grid

% 3D plot
[x, y] = meshgrid(-3:0.3:3);
z = x .* exp(-x.^2 - y.^2);
subplot(2,2,1)
mesh(z),title('subplot(2,2,1)')
subplot(2,2,2)
mesh(z)
view(-37.5,70),title('subplot(2,2,2)')
subplot(2,2,3)
mesh(z)
view(37.5,-10),title('subplot(2,2,3)')
subplot(2,2,4)
mesh(z)
view(0,0),title('subplot(2,2,4)')

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Here you can check the answer. Hope this helps.

code:

% About Graphs
x=linspace(0,5*pi,1000);
y=sin(x);
plot(x,y,'-r')

plot([2 1 4 5 3],[0 1 2 7 1],'o')
axis([0 5 0 5])

%for easy plotting

ezplot('tan(x)',[-2*pi,2*pi])

% for plotting two graphs on the same axes
% it allows to have independent y-axis labels on the left and the right.
plotyy(x,sin(x),x,10*cos(x))

% plotting options: style, marker and color
plot(x,sin(x),x,cos(x),'-r')

% polar plot
x=linspace(0,4*pi,1000);
polar(x,sin(4*x))
grid on

% 3D plot
[x, y] = meshgrid(-5:0.4:5);
z=x .* exp(-x.^2 - y.^2);
subplot(2,2,1)
mesh(z)
title('subplot(2,2,1)')
subplot(2,2,2)
mesh(z)
view(-40.5,74)
title('subplot(2,2,2)')
subplot(2,2,3)
mesh(z)
view(-40.5,-10)
title('subplot(2,2,3)')
subplot(2,2,4)
mesh(z)
view(0,0)
title('subplot(2,2,4)')1 Figure 1 - Х 2 - 3- % About Graphs x=linspace (0,5*pi, 1000); y=sin(x); plot(x,y,-r) File Edit View Insert Tools Desktop

1 plot([2 1 4 5 3], [0 1 2 7 1],o) axis ( [0 5 0 5]) Figure 1 - 2 File Edit View Insert Tools Desktop Window Help NE 5 4.51 - ezplot(tan(x), [-2*pi, 2*pi]) Figure 1 File Edit View Insert Tools Desktop Window Help ATE tan(x) 6 4 2 Command Window2 % for plotting two graphs on the same axes % it allows to have independent y-axis labels on the left and the right. plotyy(1 plotting options: style, marker and color plot (x, sin(x),X, cos(x),-r) File Edit View Insert Tools Desktop Window Help 21 Figure 1 n Х 2 % polar plot x=linspace (0,4*pi, 1000); polar (x, sin (4*x)) grid on 3 File Edit View Insert Tools Desktop Wsubplot(2,2,1) subplot(2,2,2) 0.5 0 0.5 0 -0.5 30 -0.5 20 20 20 20 10 10 10 10 00 0 0 subplot(2,2,3) subplot(2,2,4) 0.5 0.5 0

Thank you. please give me a like. it helps me a lot.

Add a comment
Know the answer?
Add Answer to:
ON MATLAB, CREATE THOSE OUTPUTS WITH DIFFERENT VALUES. BE SURE U HAVE TO CHANGE NUMBERS, COLORS,...
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 help me with this matlab problem, the answer should look like the picture below. Thank...

    Please help me with this matlab problem, the answer should look like the picture below. Thank you %1 Write an anonymous function that will receive data in the form of a plot function handle, x and y vectors, and a handle to a plot function and wil1 produce the plot. For example, a call to the function would look like the following: myPlot (@bar,x,y). x -pǐ : 0.25 : pi; y sin(x); % Piave you anonymous funcyion code here subplot...

  • Using Matlab; Please show written program to execute and instructions to create plot: 1. Create a...

    Using Matlab; Please show written program to execute and instructions to create plot: 1. Create a vector of x values from 0 to 20 pi, with an increment of pi/100. y=x sin (x) and z= x cos (x) a) create a figure window with two subplots. In first subplot create an x versus y plot and in the second subplot create an y versus z plot. b) create a polar plot of x and y. Add title and labels to...

  • N MATLAB: This is an easy problem to demonstrate how polyfit and polyval work! The values...

    N MATLAB: This is an easy problem to demonstrate how polyfit and polyval work! The values in y are basically a sine function on x. You can validate by checking in MATLAB >> x = 0:9 x = 0 1 2 3 4 5 6 7 8 9 >> y = sin(x) y = 0 0.8415 0.9093 0.1411 -0.7568 -0.9589 -0.2794 0.6570 0.9894 0.4121 Now, let us try to see what happens if we use polyfit on the values of...

  • 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);...

  • solve all questions simply by using matlab. write all step here please 1Normal 1 No Spac Heading1 Heading 2 DISCUSSION Solve all tasks given below: 1. Consider function f(x) 3.5-0.5x cos(6x) for...

    solve all questions simply by using matlab. write all step here please 1Normal 1 No Spac Heading1 Heading 2 DISCUSSION Solve all tasks given below: 1. Consider function f(x) 3.5-0.5x cos(6x) for the value of x between -2.0 until 4.0. Draw the plot in dash line and in red colour, Label the title and all axes. 2. Consider the following functions for 0sxS pi: x() 10e0.St sin(3t +2) y(t) 7e-04t cos(5t - 3) (a) Draw both graphs on the same...

  •    MATLAB SCRIPT PLEASE Matlab MATH 210 in 2020 Homework Assignment 8- Due 3/25, 11:59PM Each...

       MATLAB SCRIPT PLEASE Matlab MATH 210 in 2020 Homework Assignment 8- Due 3/25, 11:59PM Each plot should have its own figure associated with it. In all questions, give the figure a title, and label the acis. Save your matlab script as drill 10.m Do not use the fplot command. 1. Plot the function f(x) = (x + 5)2 for -5 <<<10. Include a plot title, and label both aris. 2. Use the subplot command to make two plots of...

  • Use matlab Answer 12-15 Have code to copy FUNCTIONAL DATA Create a vector of x values...

    Use matlab Answer 12-15 Have code to copy FUNCTIONAL DATA Create a vector of x values from 0 to 207 with a spacing of 7/100, where y= x' sin (x) z= x'COS(x) 12. Create an x-y plot of x and y. 13. Create a polar plot of x and y. 14. Create a three-dimensional line plot of x, y, and z. Be sure to add a title and labels 15. Figure out how to adjust your input to plot3 in...

  • ***Use MATLAB only*** Show all inputs and outputs Create the shape of an “apple” using a...

    ***Use MATLAB only*** Show all inputs and outputs Create the shape of an “apple” using a surface plot, utilizing the following equations: x = cos u (4 +5.5 cos v) y = sin u (4 +5.5 cos v) z = (cos v + sin v – 1)(1+ sin vlog (1 + 7.5 sin v 10 Where 0 Sus 21 and - SV ST, use Au = Av =1/32. Title: Apple, X-label: x, Y-label y, Z-label: πν.

  • MATLAB Any guidance is appreciated! Use meshgrid() function to create 2D grid coordinates with x- and...

    MATLAB Any guidance is appreciated! Use meshgrid() function to create 2D grid coordinates with x- and y- coordinates both from -12 to +12 in the increment 1/32. B) Calculate the function z shown below at every (x, y) point and store the result in a 2D array z Z = sin(squareroot x^2 + y^2)/ squareroot x^2 + y^2 c) Find the maximum value in array z and its corresponding index. The array may have more than one maximum points with...

  • please use matlab Goal: Solve for the loads of the chain saw under different loading conditions....

    please use matlab Goal: Solve for the loads of the chain saw under different loading conditions. The loads on a chain saw as it cuts a log can be represented with the following equations: Ar +B -R cos(60) 0 My-W +By - R sin(60)0 Ar is the reaction load in the x-direction at point A (lb) Ay is the reaction load in the y-direction at point A (Ib) W is the weight of the chain saw (lb) R is the...

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