I am trying to plot x and y with y being the only unknown but I don’t what is wrong in my code please help

2 次查看(过去 30 天)

采纳的回答

Mischa Kim
Mischa Kim 2021-1-11
Honore,
the one thing I notice is that x and y are vectors. Rewrite the y-equation using the dot operator, .^ instead of just ^:
y = ..cos(theta)^2)*x.^2;
In general, please share in your questions code rather than a screen shot of the code.

更多回答(1 个)

KSSV
KSSV 2021-1-11
  1. Your x is an array
  2. Where as theta is only a scalar.
  3. You have to make theta and x both arrays of same size.
  4. You need to use element by element operations.

类别

Help CenterFile Exchange 中查找有关 General Physics 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by