How to Downsample image in both Horizontal and Vertical Direction

D
Delilah · Mar 4, 2021 · 2K views
Question
Any one help me how to downsample image in horizontal direction and vertical direction.   i used downsample(image,4), it will down sample image in both the direction, but i need to downsample separately for horizontal and vertical.
Expert Answer
Profile picture of Kshitij Singh
Kshitij Singh PhD Expert
Answered Aug 23, 2026
For grayscale:
 
 
Xdown = X(1:2:end,1:2:end);

If it's RGB, keep the third dimension:

Xdown = X(1:2:end,1:2:end,:);
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!