Error using Cos, not enough input arguments
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Stephen23
le 5 Avr 2019
Modifié(e) : Stephen23
le 5 Avr 2019
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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Axis Labels dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!