Help!!!

5 visualizzazioni (ultimi 30 giorni)
Oluakin
Oluakin il 9 Dic 2011
Please can someone help me or explain things to me. I am lost and totally feeling bad with this lab work
que 1 Ask the user for inputs of the variables start, stop, inc and a. At runtime please enter values of 0, 30, 0.1 and 2, respectively. Plot the equation alt = sin(pi/4) + a•(t-5)2, where a is 2 and t varies from 0 to 30 with a step size of 0.1 in a figure 2. Use an appropriate FOR loop to generate and store the values of t and alt. Add a title, xlabel and ylabel to the plot. Remember to clear at the beginning and pause at the end of the code.
que 2. For the same “alt” equation above, use a WHILE loop to solve for the time t (starting from 0) at which alt crosses 600 but this time use inc of 0.01 instead of 0.1. Use the command sprintf to create an output message displaying the time at which this occurs (label your answer clearly). Remember to clear at the beginning and pause at the end of the code.
que 3
Write the following user-defined matlab functions:
1. Create the function file lastname_loopspecs.m
This function asks the users for the desired loop specifications.
function [start, stop, inc, a]=lastname_loopspecs()
start=input('Please enter a value for Start: ');
stop=input('Please enter a value for Stop: ');
inc=input('Please enter a value for the Increment: ');
a=input('Please enter the value of a');
2. Create the function file lastname_calc_alt.m
This function calculates the altitude of an object given the equation:
alt = sin(pi/4) + a(t-5)2.
function alt=lastname_calc_alt(a,t)
Using these two predefined functions and a WHILE loop, find the time t at which alt crosses 600. Set inc to 0.01 and use the same “alt” equation above. Use the command sprintf to create an output message displaying the time at which this occurs (label your answer clearly). Remember to clear at the beginning and pause at the end of the code.
  2 Commenti
Walter Roberson
Walter Roberson il 9 Dic 2011
http://www.mathworks.com/matlabcentral/answers/6200-tutorial-how-to-ask-a-question-on-answers-and-get-a-fast-answer
Jan
Jan il 9 Dic 2011
@Oluakin: You have copied the text of your homework assignment. What kind of help do you expect or need?
In addition you've posted this question in CSSM and the physicsforums.com also. This is called "crossposting" and it is confusing for the ones, who want to help you voluntarily. Either we waste the time for checking, if an answer was given in another forum already, or we waste time with posting duplicate answers.
See: http://www.mathworks.com/matlabcentral/answers/8626-how-do-i-get-help-on-homework-questions-on-matlab-answers

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Graphics Performance in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by