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
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

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

Structure Consisting of the Fields A MATLAB can also solve the sets of equations. In this illustration, the solutions for x, y, & z are returned as a structure consisting of th

The variance is generally defined in terms of the arithmetic mean as: At times, though, the denominator is defined as n instead of n - 1. The default definition used by t

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

Blanks function: The blanks function will generate a string consisting of n blank characters-that are kind of hard to see here! Though, in a MATLAB if the mouse is moved to hi

Animation: In this part we will observe a couple of ways to animate a plot. These are visuals, therefore the outcomes can't really be shown here; it is essential to type these

Functions to create special matrices: The MATLAB also has various functions which create special matrices. For illustration, the zeros function generates a matrix of all zeros

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

Illustration of Advanced file input and output: For illustration, to refer to the third number in the first element of the cell array: >> subjdata{1}(3) ans =