Question
i try to find the variance by var function but it shoew the error. I = imread('eight.tif'); var(I)
Expert Answer
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
Related Image Segmentation and Analysis Questions & Solutions
Browse All →
Explore similar technical troubleshooting questions and verified MATLAB solutions:
Ready-to-Run MATLAB & Simulink Projects
Browse All Projects →