working with excel in MATLAB script

조회 수: 4 (최근 30일)
amirmasoud kochakzadeh
amirmasoud kochakzadeh 2020년 1월 4일
답변: Image Analyst 2020년 1월 4일
Hi every one.
I have an problem with my excel in matlab, if you can, plearse guide me.
how can i compare the numerical cells which has zero value and non-zero value, then the MATLAB calculate the number of difference in each row. and at last show the column thah has zero value.
thanks.

채택된 답변

Image Analyst
Image Analyst 2020년 1월 4일
Did you try xlsread() to read in the workbook? You say you want to "compare the numerical cells" but don't say what compare means to you.
Then, after that comparison (whatever that is), you say you want to "calculate the number of difference". To find out if one variable is different from another, you can use isequal() to compare the whole variable (matrix), or use ~= to compare each element individually, like
differenceMap = matrix1 ~= matrix2; % A binary map of where they are different.
Then to count the number of differences you can sum that map
numberOfDifferences = sum(differenceMap)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

제품


릴리스

R2016a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by