extracting an output matrix from matlab - matlab

I am working on a small iris recognition system using matlab, my matlab code after several steps and algorithms gives me a 9600 bit matrix as an output, and I was wondering how can I take this matrix to process it using a Windows Forms application using C#?

There are some standard formats that you can work with them both in MATLAB and C#.
For example, you can use csvwrite function in MATLAB to save it as a comma-separated value file. The in C# there are standard ways to read a csv file. Here it is discussed how to read a CSV file in C#.
Another option is to save in a .txt file and read it in C#. HDF5 files are another type that are supported with some libraries in both (see here). You can even save your file as a regular .mat file and load it in C# using a specific API (discussed here)

Related

use matlab to handle pajek .net file?

I have a .net file which is in pajek format. Now I was thinking to use matlab to do the analysis of the data in this file. After searching online, I found a toolbox in matlab with name SBEToolbox. Considering installing this toolbox to the matlab might be a bit time-consuming, since I do not have administrative access to my pc currently. Do you have any better idea to use matlab with pajek .net file? Many thanks for your time and attention.

How to transfer Nifti file into .mat Matlab file?

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.

Writing multiple matrices to an ASCII file which can be read back into MATLAB

I want to write multiple matrices from my C++ program to a single ASCII text file, which can be read into MATLAB by some inbuilt MATLAB function as separate matrices. Does such a function exist?
(The standard dlmread function just reads one matrix per text file)

How to extract the continuation data from the MatCont continuation package on MATLAB?

I have been using MatCont for generating continuation figures for my model ODEs. Dissatisfied with the quality of figures on MATLAB, I would like to to use another program (e.g., Gnuplot) for plotting this continuation data.
In this regard, I would like to know whether there is a way of writing the continuation data to a CSV file or similar? I tried extracting data from .fig figure files that were created using MATLAB but it did not work.

View HDF5 inside matlab

Just how good is MATLAB in opening and viewing HDF5 files? I can see there are a couple of h5... commands but I'm wondering if there is a way to "view" the file interactively as you could do with a .mat file or like HDFView tool?
We use Matlab and we use HDF5 files. We also use a lot of Fortran, and one of the reasons we use HDF5 is to store datasets which can be read and written both by Fortran and Matlab. Matlab vs Fortran for HDF5 is a bit like Matlab vs Fortran for most things, the former is easier to use, lets you try out ideas quickly, and gives you much tighter integration between data and visualisation. You may have your own views on Matlab vs your favourite compiled language.
Matlab provides a complete (maybe not entirely complete, but we haven't found any features of the HDF5 Fortran APIs that we want to use that Matlab doesn't provide) interface to HDF5. When you view the document that #GuntherStruyf pointed you at, read to the bottom where you can find information about Matlab's low-level HDF5 access functions. You can do a lot with the high-level access functions alone, but not everything. And if you are already used to the HDF5 API for Fortran/C/C++, taking the same approach in Matlab and ignoring the higher-level functions is easy enough.
But we do use HDFView too, it's an easy way to trawl through an HDF5 file and, within certain limitations, an easy way to quickly edit an HDF5 file. You can, for instance, cut and paste from Excel to HDFView; perhaps more relevant you can cut and paste from Matlab's variable editor. Matlab doesn't quite provide that level of easiness for viewing HDF5 files.
To sum up:
HDFView for viewing and interactive editing
Matlab for programming for prototyping and rapid deployment
Fortran/C/C++ for programming for heavy-lifting.