Help with basic variable creation and plotting

Please write MATLAB programme for the following question:
P1.2 In a wind tunnel study of dense gas dispersion in a neutral boundary layer over a rough surface, the following Gaussian function is used to model relationship amongst the average plume concentration ratio (c), height (z) and vertical plume speed (?).
c=exp((-z^2)/(2*sigma^2))
1) Generate 201 equally spaced data points in [-7, 7] for z.
2) Generate 201 experiment noise data (mnoise) which follow a normal distribution with mean 0 and standard deviation of 0.02. (Use command “randn”).
3) Calculate values for c for all z according to the following “experiment” equation.
Sigma=2(1+0.5(0831146))
c=(exp((-z^2)/(2*sigma^2)))+mnoise
4) Plot c vs z.

9 comentarios

Walter Roberson
Walter Roberson el 5 de Feb. de 2011
Please clarify what you are asking for assistance with. Have you read the Getting Started section of the documentation?
R M
R M el 5 de Feb. de 2011
Now can you please help me to solve this question.
Oleg Komarov
Oleg Komarov el 5 de Feb. de 2011
What have YOU done so far?
R M
R M el 5 de Feb. de 2011
nothing as i dont know anything in matlab...
R M
R M el 5 de Feb. de 2011
please help.......please
Jiro Doke
Jiro Doke el 5 de Feb. de 2011
There are *a lot* of resources available, both online and in the product for you to get started with MATLAB. I highly recommend you go through that yourself.
http://www.mathworks.com/help/techdoc/learn_matlab/bqr_2pl.html
Also, you can type "doc" in MATLAB to bring up the documentation.
Having gone through those resources, you can ask *specific* programming questions. Also read this page:
http://www.mathworks.com/matlabcentral/about/answers/
Jiro Doke
Jiro Doke el 5 de Feb. de 2011
Also, I recommend taking this interactive tutorial:
http://www.mathworks.com/academia/student_center/tutorials/register.html
R M
R M el 5 de Feb. de 2011
jiro...can you please help me in writing the programme for the question as i have to submit it tomorrow and if i go through all the basics it will take me long....
Walter Roberson
Walter Roberson el 5 de Feb. de 2011
How long will it take you to fail the assignment if you *don't* read the basics?

Iniciar sesión para comentar.

 Respuesta aceptada

Walter Roberson
Walter Roberson el 5 de Feb. de 2011

0 votos

Hints: linspace, randn, mpower, mrdivide, plot

4 comentarios

R M
R M el 5 de Feb. de 2011
thank u....for ur answer it would have been great if programming was give for it...
Walter Roberson
Walter Roberson el 6 de Feb. de 2011
Yes, but then it would have been *me* doing the assignment, not you.
Walter Roberson
Walter Roberson el 6 de Feb. de 2011
Hint:
Sigma=2(1+0.5(0831146))
should be written as
Sigma=2*(1+0.5*(0831146))
Ajay  Joseph
Ajay Joseph el 31 de En. de 2014
while trying to input derivation of 0.02 the result from matlab was Warning: Size input contains non-integer values. This will error in a future release. Use FLOOR to convert to integer values.

Iniciar sesión para comentar.

Más respuestas (1)

Walter Roberson
Walter Roberson el 6 de Feb. de 2011

1 voto

You are not going to be able to solve this assignment.
Step 1 requires that you create 201 equally spaced data points in [-7,7] . The [] notation indicates that both endpoints must be included in the list, so your first endpoint is going to be -7 exactly and the last one is going to be +7 exactly. Then you have to generate 201 points in that range. That is going to give you a total of 203 points once you include the -7 and +7.
Step 2 requires that you generate 201 random points.
Step 3 requires that you mathematically combine the 203 points of step 1 with the 201 points of step 2. That is a size clash, 201 vs 203.
Your assignment therefore cannot be completed according to the required steps.

5 comentarios

R M
R M el 6 de Feb. de 2011
i have got some more questions i u can please help with those please .....just if u give me hints i would be alright for me....
Walter Roberson
Walter Roberson el 6 de Feb. de 2011
Go ahead and ask them; someone may answer. As your assignment is due today, it is not advisable to wait for the answers without continuing to try yourself, though. For example I need to repair my refrigerator and do some basement cleaning today.
Jiro Doke
Jiro Doke el 6 de Feb. de 2011
@Walter: I took the statement "Generate 201 equally spaced data points in [-7, 7]" to mean generate 201 equally spaced points that start at -7 and end at 7. So at the end, there should be 201 points, and the first point must be -7 and the last point must be 7.
Good luck fixing your fridge and cleaning your basement.
R M
R M el 6 de Feb. de 2011
Jiro can you please help me with the assignment I will send you file to ur email because it is pdf file....please give me your email...
Jiro Doke
Jiro Doke el 6 de Feb. de 2011
@RM: I don't mean to be harsh, but I need to say that this is not "MATLAB Solve My Homework Assignment" forum. Walter has given you some useful hints (functions that would be useful) to get you started. Unless you show everything that you have done so far, including any MATLAB code, you probably won't get any help. As I said before, I highly recommend you try to learn the basics by going through the "Getting Started" guide in the product. Trust me, it will help you in the long run. Since your homework is due tomorrow (or today?), you should get started right away instead of checking this post for answers.

Iniciar sesión para comentar.

Categorías

Más información sobre Get Started with MATLAB en Centro de ayuda y File Exchange.

Preguntada:

R M
el 5 de Feb. de 2011

Comentada:

el 31 de En. de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by