# MATLAB Tutorial, processing an Excel file in MATLAB 11

Posted by **Doug Hull**,

**Category:**- Format: Video,
- Level: Basic,
- Topic: Excel

## 11 CommentsOldest to Newest

**1**of 11

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.

**2**of 11

@Vallisha,

This is more of a matrix indexing question. You can use FIND to do that.

Doug

**3**of 11

Thanks a lot.

Used this :

index = find(img(:)== 160)

**4**of 11

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

**5**of 11

Take a look at xlswrite.

**6**of 11

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?

**7**of 11

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.

**8**of 11

hello,

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

**9**of 11

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

>>sum(numData) would give you the sum of all columns.

**10**of 11

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.

**11**of 11

xlswrite has a parameter xlRange: http://www.mathworks.com/help/matlab/ref/xlswrite.html#inputarg_xlRange

writetable also has this option: http://www.mathworks.com/help/matlab/ref/writetable.html

Stuart

## Recent Comments