Greetings Juan,
I understand that you are trying to show an image in FITS format using MATLAB, and you are facing some issues.
To display an image in FITS format, you can use the fitsread() function. Here is an example code snippet that you can use to open and display the FITS file in MATLAB:
% Read the FITS file
image = fitsread('sample.fit');
% Display the image
imshow(image, []);
% Add a title to the figure
title('FITS Image');
In the above code snippet, fitsread() function is used to read the FITS file and store the image data in a variable named image. Then, imshow() is used to display the image. Note that the second argument of imshow() is empty brackets [], which ensures that the grayscale colormap is used to display the image.
Read more about fitsread() and how to use it with extensions from the documentation - https://www.mathworks.com/help/matlab/ref/fitsread.html.
I hope this helps!
Regards,
Suraj.