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
조회 수: 1 (최근 30일)
이전 댓글 표시
댓글 수: 1
채택된 답변
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.
댓글 수: 0
추가 답변 (1개)
KSSV
2021년 1월 11일
- Your x is an array
- Where as theta is only a scalar.
- You have to make theta and x both arrays of same size.
- You need to use element by element operations.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!