Is there a function in MATLAB that converts a .raw file into a matrix? - matlab

I want to import a .raw file into MATLAB as a matrix (frames x spatial x spectral). Is there a built-in function to do this?

If you're referring to a raw image file from a camera, I would check out the submission RAW Camera File Reader from Bryan White on the MathWorks File Exchange.

You can also read the file directly. But you'll need to convert it to DNG first. See this:
http://blogs.mathworks.com/steve/2011/03/08/tips-for-reading-a-camera-raw-file-into-matlab/

Related

How to convert .pgm file to .mat file in Matlab?

I have to convert 'Yale' dataset whose format is .pgm to .mat file, I searched about this issue but couldn't find anything.
I appreciate any help.
Images can be saved in .mat format by using the save() function offered by MATLAB.
Let us suppose the name of your image is xyz.pgm that has to be saved as xyz.mat. Following steps should do so :
im = imread('xyz.pgm')
save('xyz.mat','im')
You can look into save() function to learn more about it.
Instead if you just want to convert it into other image formats, you should look up imwrite().

How can I convert a sound file to .mif using MATLAB?

I want to have a mif file from the sound signal of a for example mp3 file. How can I do it using MATLAB?
Thanks,
BooMZ!
As result, I couldn't find any solution to convert a MP3 file to mif. But I could convert wav file to mif. It's the instructions:
First you must drag and drop your wav file to MatLab. MatLab will make a array from wav file. Finally, you must write the data array to a file with mif format. (you can do it by fprintf)

Matlab how to open file in excel put into array and convert numbers to units of measurement

I have an excel file to open matlab and put into an array of cells - then take the numbers in the cells and convert a few measurements. how do i do this
I'd suggest looking into the two functions xlsread and xlswrite These both handle input (from an .xls or .xlsx) file to matlab and output from matlab to an excel file, respectively. If you're looking to do something different than that, please elaborate a bit more than what you've posted.

display the output from mat file

Please, any one help me: how can I display the output (image file name, mean color image, color histogarm) to see it, which I saved it in sruct of array in mat file
You can load mat files (MatLAB) formats in the free software GNU Octave.
Loading it would give you a new variable, let's say a
After you loaded it, you can display it according to the structure using octave commands.
GNU octave can be downloaded here: http://www.gnu.org/software/octave/download.html
Example hist(a)

How do I load an image file in Matlab?

I have to use Matlab to read a picture and make a joint histogram and I'm new to Matlab. When I try to read the Image by using imread function it does not work.
h= imread('a.tif');
??? Error using ==> imread at 363
File "a.tif" does not exist.
Can anyone help me figure out this problem?
One easy way to make sure you have the right path and file name is uigetfile.
To determine your path and filename, use
[filename,path]=uigetfile();
Then modify the code you have written to include the path as well. (If you're new to MATLAB, the syntax for combining two string arrays is [str1, str2])
Perhaps a.tif doesn't exist, or is located in the wrong directory ?
Since you didn't specify a path to the file then it needs to be in MATLAB's working directory (probably the same directory as where your .m file resides). Alternatively you can just specify a full (absolute) path to the .tif file.
Doesn't exist mean this image isn't supported by Matlab library
So, you should browse an image from your files but you must write URL FOR the Image like this :
a= (' D:\images\Angry Birds\bird.jpg');
imshow(a)
You need to load the picture first go to workspace then import data and select your file