views:

47

answers:

3

I have 2 functions:

f (aa) = 9 sinaa/aa + cosaa  for 0 <= aa <= 6pi.      --- >equation 1.

and f(aa) = cosku

I need to plot the allowed values of aa which will satisfy the equation 1. How do i do this i matlab?

+2  A: 

I guess this is homework, and your question is not really clear about k u but here is a short answer.

You can plot f(a) and cos(k u) on the same plot, and then graphically find the solutions of the equation.

Here is a very basic example of code:

a=0:0.01:6*pi;
f = 9*sin(a)./a+cos(a);
plot(a,f)
hold on
u = 0:0.01:6*pi;
f2 = cos(u);
plot(u,f2)
Cedric H.
a=0:0.01:6*pi; can you please elaborate this? what does this line mean?
isha
is it the range of a?
isha
Run it and test it ... Yes it defines a vector containing the adequate number of elements to allow a span from 0 to 6pi by steps of 0.01.
Cedric H.
Don't forget to put `hold off` at the end.
yuk
I m getting the graph but how do i indicate the values of a which will satisfy the equation 1??
isha
+1  A: 

If you don't know basic MATLAB syntax, you need to start at the beginning. Mathworks has published a beginner's guide for MATLAB, the Getting Started Guide. Read this, and if you have any further questions, come back to SO. You can also use the help or doc functions in MATLAB to gain more understanding about what a built-in function does. For example, doc sin will bring up the documentation page for the sin function.

Doresoom
A: 

Also look at the EZPLOT function. In addition you will also need YLIM to show the whole curve.

To get intersections of two curves you can use Fast and Robust Curve Intersections from FileExchange. For this function you can use data you've got using Cedric's answer.

yuk

related questions