MATLAB Answers


What does i mean as example: 1.2428 - 0.0003i

Asked by Matlaber on 22 Mar 2019
Latest activity Answered by alan daniel on 25 Mar 2019
What is the meaning of the result i get when i run matlab code:
1.2428 - 0.0003i
1.2320 - 0.0003i
1.2250 - 0.0002i
1.2376 - 0.0003i
1.2332 - 0.0004i


Sign in to comment.


2 Answers

Answer by Walter Roberson
on 22 Mar 2019

In this context i is the imaginary unit. Those are all complex numbers, such as complex(1.2428, -0.003)


Show 1 older comment
It bears no real relation to size. How 'big' the result is is determined by
doc abs
of that complex result. In this case you are nowhere near an integer though, even if you ignore the small imaginary part, though ignoring imaginary parts in an answer you expect to be real is rarely a good idea unless you are 100% convinced they are the result of rounding errors, as most of the time getting a complex result when you expect a real one implies something is wrong in your calculation.
"Is that mean imaginary unit means the answer is very small?"
If your high-school did not teach complex numbers then you missed out on a very important mathematical concept. There are plenty of good tutorials online which introduce complex numbers.
If you were doing something like fsolve() or fzero() then it is possible that the system you are working with has multiple answers, some of which happen to be complex valued. If you are finding the root of an equation in a single variable, then you might need to use fzero() and pass a range of values as the second parameter to confine the search to that range.

Sign in to comment.

Answer by alan daniel on 25 Mar 2019



Sign in to comment.