Question
Hi, I have a Hyperion EO-1 satellite image and i want to create an RGB band with band numbers (40,31,13) as (R,G,B). The hyperion image has 242 bands. But I'm having trouble opening the L1R file properly. I am using Matlab 2011, and 2014 hyperion image. I load the image with hdfinfo and hdfread commands like this; hdfinfo('EO1H1930282003203110PY.L1R'); fileinfo = hdfinfo('EO1H1930282003203110PY.L1R'); sds_info = fileinfo.SDS(1); hdfread(sds_info); ans=imhdf; But this loads a matrix [3128,242,256] , although it should be [3128,256,242] how can i fix this? After loading the image as 3D matrix i try to create the RGB image with selecte 3 bands as shown below it creates [3128,3,256] matrix but I cant use imwrite, imshow or any other displaying functions on it. imrgb [:,1,:] = imhdf [:,40,:]; imrgb [:,2,:] = imhdf [:,31,:]; imrgb [:,3,:] = imhdf [:,13,:]; image(imrgb); Error using image Error using image Indexed CData must be size [MxN], TrueColor CData must be size [MxNx3]
Expert Answer
John Williams
PhD Expert
Answered Aug 25, 2026
You can use the hypercube(__) function to read Hyperion EO-1 L1R files and also the colorize(__) method will help you to estimate color image of the Hyperion EO-1 L1R image.
% Read the L1R image (specify your L1R file name here)
hCube = hypercube('EO1H1930282003203110PY.L1R');
% Estimate the RGB image
rgbImg = colorize(hCube, 'method', 'rgb', 'ContrastStretching', true);
% Visualize the RGB image
figure
imshow(rgbImg)
title('RGB image')
NOTE: The above mentioned fetures come under Image Processing Toolbox's Hyperspectral Imaging Library support package, and can be downloaded from here. For more information on Hyperspectral Imaging Library see the documentation.
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 Processing and Computer Vision Questions & Solutions
Browse All →
Explore similar technical troubleshooting questions and verified MATLAB solutions:
Ready-to-Run MATLAB & Simulink Projects
Browse All Projects →