Borrar filtros
Borrar filtros

i want to plot this function

1 visualización (últimos 30 días)
sinaraper13
sinaraper13 el 2 de Nov. de 2016
Comentada: Walter Roberson el 5 de Nov. de 2016
don't no at all about this
  1 comentario
Walter Roberson
Walter Roberson el 5 de Nov. de 2016
Is the right-hand portion intended to be a rewriting of the middle portion, or is it intended that you solve the middle and right hand parts for equality in terms of one of the variables?
At first the right side looks like a rewrite, but if it were a rewrite I would expect the right side to be in terms of sin(theta_t) instead of in terms of sin(theta_i) .
Also if it were a rewrite, I would expect a range restriction to be stated, as the equation cos(x) -> sqrt(1-sin(x)^2) is not valid between Pi/2 and 3*Pi/2. cos(x)^2 = 1 - sin(x)^2 is true, but when you take the square root you have to pay attention to signs.

Iniciar sesión para comentar.

Respuestas (1)

Nick Counts
Nick Counts el 5 de Nov. de 2016
Sinaraper,
Without going into the mathematics of that function, here is a strategy for tackling a complex plotting task.
  1. Make a vector for the independent variable (In your case, I assume that's theta)
  2. Break up the expression into manageable chunks and assign their values to variables.
  3. Combine the chunks
  4. Plot
Here's a quick example to get you started:
% Step 1: Make an independant variable vector
theta = 0:0.001:2*pi();
% Step 2: Break up the expression into manageable pieces
numerator = cos(theta(1)) - cos(theta);
denomenator = cos(theta(1)) + cos(theta);
% Step 3: Combine the pieces:
expression = numerator ./ denomenator;
% Note the ./ above - this is not matrix division, but going
% element-by-element
% Step 4: Plot!
plot(theta, expression)

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by