Illustration of spreadsheet files, MATLAB in Mathematics

Illustration of Spreadsheet Files:

This reads the numbers in a double vector variable nums and the text in a cell array txt (the xlsread function forever returns the numbers first and later text). The cell array is 4 × 3. It consist three columns as the file had three columns, but as the middle column had numbers (that were extracted and stored in the nums vector), at middle column in the cell array txt consists of the empty strings.

>> txt{1,2}

ans =

    ''

>> txt{1,3}

ans =

Cindy

 

A loop can then be used to echo-print the values from the spreadsheet in the original format:

>> for i = 1:length(nums)

     fprintf('%c %d %s\n', txt{i,1}, ...

      nums(i), txt{i,3})

   end

a  123  Cindy

b  333  Suzanne

c  432  David

d  987  Burt

Posted Date: 10/20/2012 6:39:57 AM | Location : United States







Related Discussions:- Illustration of spreadsheet files, Assignment Help, Ask Question on Illustration of spreadsheet files, Get Answer, Expert's Help, Illustration of spreadsheet files Discussions

Write discussion on Illustration of spreadsheet files
Your posts are moderated
Related Questions
Complex numbers: A complex number is commonly written in the form z = a + bi here a is known as the real part of the number z, b be the imaginary part of z, and i is √-1

Example of Symbolic Expression When there is more than one variable, the MATLAB selects which to solve for. In the illustration below, the equation ax 2 + bx = 0 is solved. Th

Polar Form: Any complex number z = a + bi can be thought of as a point (a,b) or vector in the complex plane in which the horizontal axis is the real part of z, and the vertica

Standard Deviation The standard deviation is the square root of variance: The built-in function in a MATLAB for the standard deviation is known as std; the standard dev

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

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

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

Three-Dimensional Plots: The MATLAB has many functions which will display three-dimensional plots. Most of these functions have similar name as corresponding two-dimensional p

Creating Customized strings: There are many built-in functions which create customized strings, including blanks, char, and sprintf. We know that the char function can be u

Three-dimensional pie and bar: For the bar3 function, x & y vectors are passed and the function displays three-dimensional bars as shown in figure: Figure: Three-dimen