Find percent difference between 2 columns in variable?
조회 수: 7 (최근 30일)
이전 댓글 표시
So I have a variable, x, that has a size of 300x2. It calculates the fraction of an image that is white, and therefore it produces the fraction twice. I'd like to compare the percent difference between the two results for each file in the directory. Would the pDIF function be the best way to do that?
댓글 수: 2
Image Analyst
2020년 2월 19일
Never heard of the pDIF function. I presume you have 300 images, so each row of x has the white fraction twice? Where do you want the percent difference? And what is the reference for your percentage? Like for the k'th image is it
percentDifference(k) = results(k) / results(1)
where you compare everything to the first image? Or did you have something else in mind?
답변 (1개)
Srivardhan Gadila
2020년 2월 24일
There is no function pDIF in MATLAB.
The following question might help you: Percentage Difference of Values stored in Two Matrices
In case of calculating percent difference for multiple images/elements, please make use of rdivide, ./
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!