what this equation means 4*L/(2*i-1)?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
BA
el 22 de Nov. de 2023
Comentada: Alexander
el 22 de Nov. de 2023
I am trying to convert this equation 4*L/(2*i-1) into R
I failed to undersatnd why the output is two negative values in matlab
but R'output is a single value
L= 17;
i=4;
(2*i-1) gives -1 + 2; Is it i here is a complex number?
3 comentarios
Torsten
el 22 de Nov. de 2023
Editada: Torsten
el 22 de Nov. de 2023
If you use the expression 4*L/(2*i-1) in R, I guess that "i" was set to a value somewhere before in the R-code. If you set "i" to the same value in your MATLB code, MATLAB will compute the same value for the expression as R does. If you don't set "i" to a value before you compute the expression, MATLAB will interprete "i" as the imaginary unit.
L = 17;
i = 4;
4*L/(2*i-1)
clear i
4*L/(2*i-1)
Alexander
el 22 de Nov. de 2023
Never use i or j if you are not dealing with complex numbers. Use ii or jj instead if you have to.
Respuesta aceptada
ScottB
el 22 de Nov. de 2023
Yes, Matlab sees "i" as complex. Maybe pick another variable if you are just using scalars.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Matched Filter and Ambiguity Function en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!