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
How do I write a product series running from i to n of x''s using a for loop?

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

Customizing Plots : There are numerous ways to customize figures in the Figure Window. On clicking the Plot Tools icon will bring up the Property Editor & Plot Browser, with ma

bar and barh functions: For a matrix, the bar and barh functions will group altogether the values in each and every row. The illustration is as shown: rm = randint(2,4,[1

5 p2+8p+15, 3 p2-3p-18, 12 p2-p-30

Function xlsread - file function: The function xlsread will read from the spreadsheet file. For illustration, to read from file just generated: >> ssnums = xlsread('ranexc

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

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

Illustration of logical built-in functions: The function find returns the indices of a vector which meet certain criteria. For illustration, to find all the elements in a vect

Script a MATLAB program which meets the following speci cations: The program expects an input of a two-variable real-valued continuous function f : R^2--> R The program is to cal