How to find the variance of an image?

sachin · Mar 13, 2023 · 1.9K views
Question
i try to find the variance by var function but it shoew the error. I = imread('eight.tif'); var(I) 
Expert Answer
Profile picture of Prashant Kumar
Prashant Kumar PhD Expert
Answered Aug 24, 2026

var requires a double or single argument. This will work:

 

img = double(imread('eight.tif'));
v = var(img);

But note that will give a vector, with one value for the variance of each column of the image. To get the variance of all the pixels in the image, you'll need

v = var(img(:));

 

100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!