필터 지우기
필터 지우기

i want to plot this function

조회 수: 1 (최근 30일)
sinaraper13
sinaraper13 2016년 11월 2일
댓글: Walter Roberson 2016년 11월 5일
don't no at all about this
  댓글 수: 1
Walter Roberson
Walter Roberson 2016년 11월 5일
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.

댓글을 달려면 로그인하십시오.

답변 (1개)

Nick Counts
Nick Counts 2016년 11월 5일
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)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by