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
Illustration of nested function: The output arguments are distinct from variables. The scope of an output argument is merely the nested function; and it cannot be used in the

Counting in a While Loop: Whenever it is not known ahead of the time how many values will be entered into the script, it is often essential to count the number of values which

Creating string Variables: The string consists of a few numbers of characters (including, possibly, none). These are the illustrations of the strings: '' 'x' 'ca

Illustration of Empty vectors: The Empty vectors can also be used to delete elements from the arrays. For illustration, to remove the third element from array, an empty vector

Concatenation: The String concatenation means to join the strings altogether. Of course, as strings are merely vectors of the characters, the technique of concatenating vector

Common form of the switch statement: The common form of the switch statement is as shown below:   switch switch_expression   case caseexp1    action1   case cas

Illustrations of Variable number of output arguments: In the illustrations shown here, the user should actually know the type of the argument in order to establish how many va

Strings as matrix: The matrix can be generated, that consists of strings in each row. Therefore, essentially it is created as a column vector of strings, but the final result

This project requires you to use the ideas of Chapter 25 regarding maximization of a function. Here we assume that evolution has acted to generate highly efficient foragers. By hig

Logical Vectors: The relational operators can also be used with the vectors and matrices. For illustration, let's say that there is a vector, and we want to compare each eleme