I'm very, very new to Matlab.
With that said, does anyone know how to convert a CSV file into a .mat file in the MATLAB environment? I've had a lot of trouble answering this question.
The CSV file in question is just a 600x30 matrix of numbers.
Thank you!
Related
I am currently working on a disparity map estimation project in Matlab. I am using the middlebury datasets including ground-truth disparities in PFM format. I don't know how to load this particular format in Matlab. Could anyone help me? Thanks
I have tried a simple load and then read in the documentation that the load function does not support the pfm format.
I have an EEG signal with .cnt and .fdt files. I have to obtain images to use it as input to a cnn. Is it possible to convert the file to images? Someone please help me with this. If possible then specify how to do it.
You should download EEG tollbox such as EEGlab or FieldTrip. I prefer fieldtrip because it is script based while EEGlab is more about GUI. Here you can see fieldtrip's function ft_read_header that can deal with your files, and here is a basic script to read cnt files with fieldtrip functions
How do I train images and make a .mat file?
I am trying the following simple matlab program :
http://in.mathworks.com/matlabcentral/fileexchange/22030-image-retrieval-query-by-example-demo
Documentation
https://ece.uwaterloo.ca/~nnikvand/Coderep/imQuery/documentation.html
Now, this zip package already includes a .mat file which has histograms of all the sample images provided for querying.I want to query over my own sample-set of images.
I figured out that I need that getimagehist function to calculate the histogram and populate a database of my images in .mat format. but how exactly do i do it? I am a newbie in matlab that's why i have no idea. A little guidance/help will be greatly appreciated.
In Matlab, the .mat format is used for saving Matlab workspaces. You can create .mat files with
save(filename,variables)
It is documented here: http://se.mathworks.com/help/matlab/ref/save.html
If you need help in creating the histograms from images, check imhist: http://se.mathworks.com/help/images/ref/imhist.html
As an example of saving a histogram in .mat file
myHistogram = imhist(image);
save('myMatFile', 'myHistogram');
I have a Nifti file, the size of which is 62*62*38. How can I transfer the Nifti file to .mat Matlab file?
Most medical imaging data can be manipulated effectively using some kind of toolbox, such as SPM. However, if you need to gain access to the raw matrix I've always used NIfTI tools from the Mathworks file exchange site (here).
There are two functions that are relevant here: load_nii and load_untouched_nii. The first function load_nii takes care of situations where the header in the NiFTI contains transformations that haven't been applied to the underlying data matrix. If you know that no such transformations exist, you can use load_untouched_nii to avoid the reslicing being done. Both functions return a structure, and the data matrix is located in the img field of the returned structure.
This can read NIFTI as well as many other medical image file types into MATLAB arrays, which you can then save as .mat files.
FreeSurfer has a MATLAB function called "MRIread". It can read NIFTI (.nii, .nii.gz) files into a MATLAB structure, which can then be saved to a MAT file if so desired.
I have a .csv file that has a column of data being complex. When I use data = load(file_name), the imaginary parts of that column are all discarded!
How may I import them into MATLAB without losing my imaginary part?
Using csvread() should help you here. It does support reading in complex data if your column data is in complex format.
Check the MATLAB documentation: http://www.mathworks.com/help/matlab/ref/csvread.html and look under the Algorithms heading.