cell array isn't supported by Matlab coder - matlab

I have a list of matrices. I want to use Matlab coder to get the corresponding c code and hence run the program faster. However, cell array is not supported in Matlab coder. Is there any other way to make a list of matrices so that Matlab coder supports the resulting list of matrices?

Related

find blocks in sparse matrix (matlab)

I have symmetrical sparse matrices. Some of the elements would form "blocks" or "components" .
Please look at the output of spy on example matrix.
I want to efficiently find those clusters in MATLAB.
This problem is equivalent to finding connected components of a graph, however I have a feeling that relevant functionality should be available as a (combination of) fast MATLAB built-in functions that operate on sparse matrices.
Can you suggest such combination?
OK, found graphconncomp function in bioinformatics toolbox. It uses some mex routines internally.

cell array is not supported for my hdl coder in matlab,, how to fix it

while converting my .m file in matlab to vhdl using hdl coder iam getting cell array is not supported . How to fix these errors while fixed point conversion
As you wrote, cell arrays are not supported as input arguments or return values. This is a limitation in MATLAB codegen products such as MATLAB Coder and HDL Coder. You'll need to modify or wrap the function to use supported types. A commonly used option is to replace cell arrays with structures. See:
http://www.mathworks.com/matlabcentral/answers/63288-removing-cell-arrays-from-code

MATLAB kmeans not working for SURF/BRISK Points vectors

Background Information
I'm trying to apply Bag of Words on SURF/BRISK features as an experiment on the Cats/Dogs dataset. I've extracted all the features into a vector.
Issue:
When I feed the vectors into kmeans(points, numPts*0.04) it says that:
Undefined function 'isnan' for input arguments of type 'BRISKPoints'
The problem here is that BRISKPoints is a MATLAB object, not a numeric matrix. You cannot do k-means on it directly. What should go into k-means is the output of extractFeatures. Note that extractFeatures can return either SURF or FREAK descriptors depending on the type of the input points or the value of the 'Method' parameter. You can use k-means to cluster SURF descriptors, which are simply numerical vectors, but not FREAK descriptors, which are strings of bits encapsulated in a binaryFeatures object.
By the way, as of R2014b there is built-in support for the bag of words image classification in the Computer Vision System Toolbox. Please see this example.

is it possible to use cell array in matlab function block in simulink?

i have a Structure that describe my fuzzy system and I'm gonna to use it on MATLAB Simulink in general for fuzzy type 1 i could use fuzzy logic controller block BUT i have fuzzy type 2 and a structure describe it's membership functions and other attribute, i have to use it on simulink but matlab function block in simulink can't generate code for a cell array and i receive error.
so i ask you guys please help me:
is it possible to use cell array in matlab function block in simulink?
The MATLAB Function block supports all the data types that Simulink supports, see Data Types Supported by Simulink, and so I believe cell arrays aren't supported. However, you should be able to use the Fuzzy Logic Controller from the Fuzzy Logic Toolbox.

Unexpected Behavior of MATLAB Builder

I've a MATLAB function which computes a histogram difference between two color histograms. I've converted it into a corresponding JAR file using MATLAB Builder.
Now, when I try to retrieve the value, it's giving some unexpected results.
The same code when executed in MATLAB for the same arguments is giving a different answer than that given when using Java.
The difference between both answers is quite large, so, it cannot be neglected.
Code is at:
https://gist.github.com/835910
Can any one tell me the reason why this is happening?
The only thing that immediately jumps out at me is that you're returning a matrix. And in Java, matrices are stored row-major but in Matlab they are stored column major.
So: is the data your sending to Matlab column major compatible? And are you interpreting the answer (hist) as column major?
This is a bit of a shot in the dark...