Error using Cos, not enough input arguments
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello, I'm having a problem with the cosine and sine functions in MatLab. I'm trying to replicate the effect of a plasma actuator in matlab which involves adding a source term that replicates the effect. The source term involve a Guassian function;
a = (cos^2*(pi/2)/2*Ox^2) + (sin^2*(pi/2)/2*Oy^2);
b = (-(sin*2*(pi/2)/4*Ox^2 + (sin*2*(pi/2)/4*Oy^2)));
c = (sin^2*(pi/2)/2*Ox^2) + (cos^2*(pi/2)/2*Oy^2);
with the source term being;
Su = A*exp(-(a(x-xc)^2 + 2*b(x-xc)*(y-yc) + x(y-yc)^2));
when i try running, it says error using cos, not enough input arguments. Does anyone know where im going wrong?
Thanks
댓글 수: 0
채택된 답변
Stephen23
2019년 4월 5일
편집: Stephen23
2019년 4월 5일
cos^2*(pi/2) % incorrect
cos(pi/2)^2 % correct
Your code has several other syntax errors, such as:
Ox % what does this mean?
Oy % what does this mean?
and
b(...) % if this is supposed to be multiplication, then you actually need:
b*(...)
You should learn basic MATLAB concepts by doing the introdcutory tutorials:
and also reading the documentation for every operation that you use, no matter how trivial you think it might be. You should also learn about vectorized code:
댓글 수: 2
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Axis Labels에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!