https://ch.mathworks.com/help/images/ref/hyper.io.hypercube.enviwrite.html
enviwrite - Write hyperspectral data to ENVI file format - MATLAB
This MATLAB function writes the hyperspectral data stored in the hypercube object to an ENVI (Environment for Visualizing Images) file format.
to envifile formatwritehyperspectraldata