Stuart’s MATLAB Videos

Watch and Learn

MATLAB Tutorial, processing an Excel file in MATLAB 16

Posted by Doug Hull,

It is very common to read through all the values in an Excel spreadsheet to process them in MATLAB. Here is a simple example of importing Excel in MATLAB and looping through the values.

16 CommentsOldest to Newest

vallisha replied on : 1 of 16

Hello Sir,

Suppose I have the pixel value, how to find the corresponding pixel position in image ?

Ex: If the pixel value is 160, i want to get the positions of the pixels in the image for which the value is 160.

Chen replied on : 4 of 16

Hi,

I can write cells to Excel if numbers are specifid.
I can write simple matrices to excel.

But, is it possible to write something like this to excel:

a=[1 2; 3 4 ; 5 6]
d={‘Temp’, Time; a}
xlswrite(‘ExcelNmae’, d);

Thanks,

Chen

Mohammed Qahwaji replied on : 6 of 16

If I have an excel sheet that have only numbers on it. And I want to find how much some values repeated.( like how many times there is number 6 in the excel sheet?) how can I find these values by matlab?

Doug replied on : 7 of 16

First I would import into MATLAB with XLSREAD. Once you have a matrix in, like

a = [11 22 33 22 22]

nnz(a == 22)

will do what you want for 22.

Abby replied on : 8 of 16

hello,
How can you find the total amount of the column from the excel spreadsheet, by using a formula in Matlab?

Stuart McGarrity replied on : 9 of 16

>>sum(numData(:,1)) would give you the sum of column 1
>>sum(numData) would give you the sum of all columns.

Deepak replied on : 10 of 16

Hello,

I want to write particular column of an excel sheet with some values (1), the excel sheet already has some values in 20 rows and 6 columns, but at the end of the program i want to add value 1 in 7th column for given 20 rows. Will anyone help me out.

Krupali Katakiya replied on : 12 of 16

hello sir,
i have made a datasheet using text format for a matlab program.and now i want to call a specific data from that list(datasheet).how can i do that? can you help me?

Stuart McGarrity replied on : 13 of 16

Hi Krupali, To confirm, is your data stored in an Excel file (e.g. .xlsx)? What MATLAB function did you use to store it? What does your data look like (i.e. # rows, column, data types, headers)? What version of MATLAB do you have? What have you tried to import the data so far?

Kajal replied on : 14 of 16

Hello sir,
I want all programs run at a time in just 1 click and also it read all programs , database which I want to execute . Can u tell me what I do for that . Is there is any code for linking all programs database or any further process . Please send me as early as possible. I am waiting for that .
Thank u…

Add A Comment

What is 8 + 9?

Preview: hide