Question

Need help with this Matlab program %% Exercise 1 % NOTE: Please suppress output--i.e., use a...

Need help with this Matlab program

%% Exercise 1

% NOTE: Please suppress output--i.e., use a semicolon ';' at the end of any
% commands for which the output is not necessary to answer the question.
% Delete these notes before turning in.

% Define input variable theta as discretized row vector (i.e., array).
theta = ??;

% Define radius.
r = ??;

% Define x and y in terms of theta and r.
x = ??;
y = ??;

% Check that x and y satisfy the equation of a circle.

%%
% Explain results here. Do x and y satisfy the equation of a circle? Why or
% why not? How does the vector output at the end confirm your answer?
% Notice I did not include text in the same line where the double-comment
% is. What this accomplishes is it does not add a title or create a new
% section in the table of contents when you publish. Using single %
% starting in the line after the %% turns the comments black as opposed to
% green.

%% Exercise 2

% Define t-vector.
t = ??;

% Define y-vector.
y = ??

%%
% Part (a)

% Plot results (should have 3 plots total).
figure;
plot(??);
title('??')


%%
% Part (b)

% Plot results as data points only and as data points with line.
figure; % creates a new figure window for next plot
plot(??);
title('??')

figure; % creates another figure window
plot(??);
title('??')

%% Exercise 3

% Create t-vector (choose enough elements so that plot is smooth!)
t = ??;

% Define x,y,z components in terms of t.
x = ??; y = ??; z = ??;

% Plot resuls.
figure;
plot??)

% NOTE: if graph does not look smooth, use more elements in your
% t-vector--i.e., use smaller stepsize between elements. Delete these notes
% before submission.

%% Exercise 4

% Define input variable as vector.
x = ??;

% Define y and z.
y = ??;
z = ??;

% Plot results.
figure;
plot(??)
axis tight;
grid on;

%% Exercise 5

% NOTE: you must create the M-file ex5.m separately and invoke it here in
% your main M-file (main file).

% Print out the code for your created M-file (do NOT submit M-file
% separately).

type 'ex5.m'

% Run your M-file--i.e., execute the M-file.

run 'ex5.m'

%% Exercise 6

% For part (b), you need to create a separate M-file (f.m) and invoke it in
% the main file, here. Erase these notes upon submission.

%%
% Part (a)

% Define g as anonymous function.
g = @(x,y)(??);

% Evaluate g at the given values of x and y

%%
% Part (b)

% Clear the function g out of the workspace.

% Print out g.m contents.
type 'g.m'

% Evaluate g at the given values of x and y
%% The End!!!

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

Exercise 1 sol

Add a comment
Know the answer?
Add Answer to:
Need help with this Matlab program %% Exercise 1 % NOTE: Please suppress output--i.e., use a...
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
  • 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...

  • Please help with this exercise in Matlab 4 The range of an object shot at an...

    Please help with this exercise in Matlab 4 The range of an object shot at an angle θ (with respect toxaos), with the initial velocity of Va (in the absence of air resistance), is calculated by the following formula: va , sin(20) Range (0 052) And the trajectory of object is given by where h is the height of the object at each x location and g 9.81 m/s. Using n/8 increment size for the angle and Vo-10 m/s, plot...

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

  • yes you will need matlab software Can someone please help me. attached is the exercise i...

    yes you will need matlab software Can someone please help me. attached is the exercise i am doing in matlab. also attached is the exercise that i am suppose to be doing.also attached is part a of my code and part b. also attached is an error code i am getting. can someone please help me with this. thanks. explain in detail what i am doing wrong and what i need to do to fix it. you use enogn polnts...

  • I DESPERATELY NEED HELP WITH THIS DIFFERENTIAL EQUATIONS MATLAB ASSIGNMENT IM SUPPOSED TO BE LEARNING BUT...

    I DESPERATELY NEED HELP WITH THIS DIFFERENTIAL EQUATIONS MATLAB ASSIGNMENT IM SUPPOSED TO BE LEARNING BUT WE HAVE A SUB AND HE DIDN'T TEACH IT! ITS EULER AND IMPROVED EULER IN MATLAB! HERE IS THE LINK FOR THE IMAGE FILE THAT SHOWS THE FULL INSTRUCTIONS FOR THE CODE. https://imgur.com/a/gjmypLs Also, here is my code so far that I borrowed form an old assignment but the data is all wrong and the application of the code is slightly different so either...

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

  • Compute the following problems using Math Lab.   Instructions: Answer All Questions using MATLAB commands. Question 1....

    Compute the following problems using Math Lab.   Instructions: Answer All Questions using MATLAB commands. Question 1. Create a vector of the even whole numbers between 31 and 75. Question 2. Let x [2516] a. Add 16 to each element b. Add 3 to just the odd-index elcments c. Compute the square root of each element d. Compute the square of each element Question 3. Let x 13 268T and y [4 1 3 5] (NB. x and y should be...

  • Please show matlab editor and command window B. (4 pts) Use the : operator to create...

    Please show matlab editor and command window B. (4 pts) Use the : operator to create the vectors x [2.5,1.50.5,-0.5,-1.51 and y [0.4,0.8,1.2,1.6,2], then use them in the following expression to compute vector z using element-by-element calculations C. (8 pts) A 70 lb bag of rice is being pulled by applying a force F at an angle θ as shown. The force required to drag the bag is given by: θ μ sin θ + cos θ Where u-0.35 is...

  • This is a c++ question note: not using  namespace std; at the beginning of the program Writing...

    This is a c++ question note: not using  namespace std; at the beginning of the program Writing Data to a File This program will write a series of letters, starting with 'A', to an external file (letters.txt). The user will decide how many letters in total get saved to the file. ** IMPORTANT: The test cases will evaluate your code against .txt files that I uploaded. You do NOT have to upload your own txt files. Input: Including 'A', how many...

  • please do this problem in matlab and show me the code. Thanks. please do this problem...

    please do this problem in matlab and show me the code. Thanks. please do this problem in Matlab and show me the code. Thanks. Problem #1: Circuits and linear-systems In the last HW you developed the governing equations for the “Wheatstone”-bridge circuit used extensively in engineering applications (shown below). B R R2 A D G m RA с E The resulting equations were solved for the output voltage and currents using the function: function [V_out, I_vector] =Wheatstone_bridge (v_in, R_vector) In...

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