Invalid use of operator

I try to make the graph of this equation:
I(a) = a^6 * (K1 *K3 - K2^2)
where
a = [0,5,100]
K1 = besselk(1,a)
K3 = besselk(3,a)
K2 = besselk(2,a)
my code is
I = (a.^6)*(K1.*K3.-K22.)
and I get "invalide use of operator" for (-) symbol. I can not understand why. Can please anyone help?

Respuestas (1)

Fangjun Jiang
Fangjun Jiang el 24 de Sept. de 2021

0 votos

There is a difference between operator "*" and ".*". But there is no such an operator as ".-" in MATLAB.

3 comentarios

Maria Mamai
Maria Mamai el 24 de Sept. de 2021
Do you know how can I fix that?
a = [0,5,100]
a = 1×3
0 5 100
K1 = besselk(1,a)
K1 = 1×3
Inf 0.0040 0.0000
K3 = besselk(3,a)
K3 = 1×3
Inf 0.0083 0.0000
K2 = besselk(2,a)
K2 = 1×3
Inf 0.0053 0.0000
I = (a.^6) .* (K1 .* K3 - K2.^2)
I = 1×3
NaN 0.0836 0.0000
Maria Mamai
Maria Mamai el 24 de Sept. de 2021
Thank you very much!

Iniciar sesión para comentar.

Categorías

Más información sobre Symbolic Math Toolbox en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 24 de Sept. de 2021

Comentada:

el 24 de Sept. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by