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 =



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


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

Function isreal - complex numbers: The function isreal returns 1 for logical true when there is no imaginary part of the argument, or 0 for false when the argument does have a

Plot Functions: Faraway, we have plotted to generate two-dimensional plots and bar to generate bar charts. We have seen how to clear the Figure Window by using clf, and how to

If I have a vector representing the packed storage form of a symmetric matrix, how do I perform a cholesky factorisation on that?

sprintf function: The sprintf function works precisely like the fprintf function, but rather than printing it generates a string. Here are some illustrations in which the outp

how can reconstruct just part of an image using imreconstruct?

Example of Logical built-in functions: For equivalent to all the function, we should make sure that the entire elements in the vector are logically true. The one way of doing

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 fprint

User input in the while loop: Here is an illustration of running this script: >> readonenum Enter a positive number: -5 Invalid! Enter a positive number: -2.2