Print an imaginary number, MATLAB in Mathematics

Print an imaginary number:

To print an imaginary number, the function disp will show both parts automatically:

>> disp(z1)

   4.0000 + 2.0000i

The function fprintf will print only the real part unless both parts are printed individually:

>> fprintf('%f\n', z1)

   4.000000

>> fprintf('%f %f\n', real(z1), imag(z1))

4.000000 2.000000

>> fprintf('%f + %fi\n', real(z1), imag(z1))

4.000000 + 2.000000i

Posted Date: 10/22/2012 8:54:55 AM | Location : United States







Related Discussions:- Print an imaginary number, Assignment Help, Ask Question on Print an imaginary number, Get Answer, Expert's Help, Print an imaginary number Discussions

Write discussion on Print an imaginary number
Your posts are moderated
Related Questions
5 p2+8p+15, 3 p2-3p-18, 12 p2-p-30

Symbolic Expression The solve function solves an equation and returns the solution(s) as symbolic expressions. The answer can be converted to numbers by using any numeric funct

How do I write a product series running from i to n of x''s using a for loop?

Find Minimum and Maximum for each row To find the maximum (or minimum) for each row, the dimension of 2 (that is how a MATLAB refers to rows) can be identified as the third arg

Example of Minimum and Maximum Value For matrices, the functions min and max operate column wise by the default: >> mat = randint(2,4,[1 20]) mat =    9   10   1

Dimensions - matrix: The size and length functions in the MATLAB are used to find array dimensions. Length function returns the number of elements in the vector. The size func

Differentiation: The derivative of a function y = f(x) can be written as follows or f  '(x) and is defined as the rate of change of the dependent variable y with respe

Indexed empty matrix: The Individual elements cannot be eliminated from matrices, as matrices always have the similar number of elements in every row. >> mat = [7 9 8; 4 6

Built-in functions for Complex numbers:   We know that in MATLAB both i and j are built-in functions which return √-1 (therefore, they can be thought of as built-in constants).

User-defined functions: Therefore, although many functions compute and return values, some do not. A few functions rather merely accomplish a task. Regardless of what type of