How to load .csv of complex numbers in MATLAB? - matlab

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.

Related

Read a .pfm file in Matlab?

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.

Training SVM classifier in MATLAB with numeric+text data

I want to train a SVM classifier in MATLAB for threat detection. The training data is in Excel file and contains both numeric and text fields/columns. When I export this data to MATLAB, it is either in table or cell format. How do I convert it in matrix format?
P.S: Using xlsread function does not import text data.
There are 4 type of attributes in data. Numerical ,discrete , nominal and ordinal. Here you can read more about them . First run an statistical analysis for each feature in your dataset to know the basic statistics such as mean, median, max , min , variable type and if it like nominal or ordinal distinct words and all. So you then have a pretty good idea what you are dealing with.Then according to the variable type you can decide which vectorization we are using.if it is an numerical variable you can divide it into different classes and feature scaling . if it an ordinal variable you can give logical order . if it is nominal variable you can give a identical numerical names. Here , you are just checking how much each feature bring the impact to final prediction
My advice , use Weka GUI too to visualize the data. Then you can pre process the data with column by column
You need to transform your text fields into numeric using dummy variables or another technique, or drop them entirely if they actually are id's (e.g. patient name for medical data, record number, respondent uuid for a survey, etc.)
This would actually be easier in R or Python+Pandas, but in Matlab, you will need to perform encoding by yourself, working from the cell array towards a matrix. Or you can try this toolbox.

Clustering and classification

I need to perform clustering and classification on data, which is present in a csv file. The data is in form of simple text containing the vendor names.
Is there some free library available for this task?
Thanks,
Ashish
I don't understand what you mean by "clustering a classification" since those two are different from each other, but you can do clustering and classification with these libraries:
Python-Scikit
Java-weka
First convert your Dataset from csv to arff using the following link.
http://www.cs.ccsu.edu/~markov/MDLclustering/MDLmanual.pdf
After doing this please let me know that what are your expectations from the data as every algorithm in weka show some different results.
You can simply apply k-means and any other algorithm once you convert the data.

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.

Binning/averaging data in Matlab

I'm currently trying to solve this; I have an idea of how to do this, but I would really appreciate any extra input I could get.
I need to come up with a Binning function that takes in raw thickness data from a trace file, that is read in by another function. I need to put this data in 5mm bins. The tricky part will be to smooth fit the curves at both ends, and also perform data validation of the input data.
In summary: I need to take data values and "bin"/average them in 5mm intervals.
Thanks guys.
It sounds like you want the hist() function, which creates a histogram by binning the input data.