How to implement fixed point operations without Fixed Point Designer Library in Matlab? - matlab

I am supposed to work with an existing code in my work and at some places the previous programmer has extensively used Fimath function. Unfortunately, I am not having the license for the Fixed Point Designer toolbox and was looking for some alternatives.
I tried getting the fimath.m file from another source but it is referencing to some embedded libraries in the toolbox.
Is there some other way in which I can bypass this problem?
Thank You

Related

Automatic documentation generation for Dymola code

since I could not find an answer to my question neither here nor in other forums, I decided to ask it to the community:
Does anybody know if and how it is possible to realize automatic documentation generation for code generated with Dymola?
The background for this e. g. is that I want/need to store additional information within my model files to explain the concepts of my modelling and to store and get the documentation directly from the model code, which I would later like to be in a convenient way displayable not only from within Dymola, but also by a html and LaTeX documentation.
I know that there exist several tools for automatic documentation generation like e. g. DoxyGen and Python Sphinx, but I could not figure out if the can be used with Dymola code. Plus, I am pretty new to this topic, so that I do not really know how to find out if they will work out.
Thank you people very much for your help!
Greetings, mindm49907
If you mean the Modelica model code, how does the HTML export in Dymola work for you? What's missing?
If you mean the C code generated by Dymola, the source code generation option enables more comments in the code.

Integrating Matlab with C++

I need to localize facial landmarks as a part of my research project and planning to use Supervised Descent Method (SDM) for that. Both the C++ and Matlab versions are available at the following site and when I contacted them they said C++ version is not going to be available until they secure it. So, I had no other option and had to opt for Matlab version.
http://www.humansensing.cs.cmu.edu/intraface/download_functions_matlab.html
The problem is that My project is in C++ and OpenCV. I wonder whether there is a way to access Matlab version of SDM in Visual C++ . I mean, is there an integration mechanism available for that ?
And, the next issue is when executing the "Facial Feature Detection" code available at the above site I get the following error.
I executed it as given below.
[detected_points] = xx_track_detect(Model,[],image,[],options);
and, it says "undefined function or variable named 'model' "
anyone have a solution to this ?
It seems like you need to use Matlab engine to be able to execute Matlab commands from C++. The engine interface allows you to do just so.
Regarding the model variable - it is probably a representation of the learned model for facial landmarks, it should be supplied with the packge or you need to tune it by yourself. Without additional information I suggest you contact the publishers of the package for more information.

Converting Matlab GUI into a guide GUI

I have inherited a pile of Matlab scripts that manually build a GUI using calls to uicontrol, uimenu, etc. Over the years we have needed to remove and add elements to the GUI and since all the positions are specified manually in the scripts, the layout hasn't really changed to accommodate the missing elements so it is really starting to look like a pile of trash.
Is there a way to automatically convert my matlab scripted gui into something I can use with guide? I would rather not have to start over...
GUIs generated with GUIDE are not much better than manually scripted ones (if not worse in my opinion in terms of maintainability).
The sad truth is that there are no builtin layout managers in MATLAB (there are user-contributed ones on FEX like border layout, gridbag layout and others). If you are refactoring the code, please consider using some sort of GUI layout manager.
To answer your question, afaik there is no automatic tool for such a conversion.
To be exact, MATLAB has some undocumented layout managers: uiflowcontainer and uigridcontainer. See this article by Yair Altman
Well, there is no automatic conversion utility but you dont need to create everything from scratch with GUIDE.
Execute your GUI so that it shows up and save the figure window as a fig file. This file then can be edited with guide.
However this needs manual adjustments in your code. Especially if you need access to handles and I am also not sure about the callback functions.
However, as Amro already pointed out, GUIDE is not a perfect solution.

Matlab Vs. Maple for curve fitting to data, finding eq'n of curve then integrating through code

Im sure there are a thousand different posts on Maple vs Matlab, but i have a bit of a unique set of requirements and before i go off to learn one of the two i would like to know which one will do it best.
I have a set of data from an accelerometer recording an impact. I need to do the following:
fit a curve to the data
Find the equation for that curve
solve the equation listed at the link
http://upload.wikimedia.org/wikipedia/en/math/2/d/3/2d39556df1dbbd467dc914253e93cdb0.png
which solves for a family of curves,i.e the MAX under the interval.
I would like to do this as seamlessly with visual studio as possible. The GUI and all the other elements of the app are built in VB and I would like to keep it there. I know maple has a code generating part to it that will convert to VB, would it be able to handle something like this? Does Matlab integrate with Visual Studio well? I would be thrilled if there was an object i could place on the VB form which would facilitate the communication to and from the matlab or maple framework. Currently i have it working with R, however to do so i need to write the data to a file, launch the R script, wait for it to finish, return control to my VB app and take it from there. This process takes too long and since i do not have experience with multi threaded programming the GUI freezes up when control is passed to the script.
Any help or suggestions would be very much appreciated!
In your case I would choose neither of the two. You may have a look at Python Tools for Visual Studio. The blog post mentions support for NumPy & SciPy for .Net which gives you all the math power you need at hand well integrated in the .Net world.
EDIT:
By looking at matplotlib's gallery I'm tempted to say that matplotlib is on par with MATLAB.
MATLAB doesn't auto-generate VB code, but it can easily be called from a VB application without the indirection of writing a file. It has COM interface that can be called directly from within VB code. See this example from the MATLAB documentation to find out more.
To carry out the technical analysis you've mentioned, you would probably save time by using Curve Fitting Toolbox in addition to base MATLAB.
Note that the above method of connecting to MATLAB via its COM interface relies on there being a live copy of MATLAB present when the VB application is executed. If you need to share your application with people who don't have a copy of MATLAB, you can also create standalone COM components and .NET assemblies from MATLAB code that can be called in the same way by your VB code, but can be deployed freely to people without a MATLAB license - however, this requires an extra product, MATLAB Builder for .NET.

Where can I find good open source code flow visualization software?

I am working on an academic research regarding some very long functions in the Linux kernel (link, link).
For that research, I would like to use some code flow visualization tool, that would be able to plot a graph in which each vertex is a decision point and each edge is a piece of code which runs in a consequent way.
Do you know of any good, open source project that can visualize C code?
Perhaps a tool like KCacheGrind would be of help. It generates call graphs based on actual calls and cannot pre-generate a call graph without actually running the program, which may not suit your needs, but then it again it may.
History flow's are very neat for changes/diff across multiple versions.
Codeplex has a project, Dependency Visualizer which does support C also.
Gprof2Dot can render oprofile, this would get you dynamic info also.
CodeViz also (static tool) would work.
If your using gcc, gcc-xml has an introspector plugin also todo this.
You appears to want to acquire a flowchart of C source code ("decisions", "code blocks").
Something like this C flowchart?
To do this correctly, esp. for Linux kernal code, I'd expect you to have to preprocess the code first to get rid of macros and conditionals. I would assume that GCC would construct such a graph internally and that you ought to be able to get your hands on that graph.
Doxygen does some amount of 'visualization',
but you need to work on the code a bit for it to be usable.
Another interesting thing to check would be lxr
Linux Cross Referencer is a software toolset for indexing and presenting source code repositories. LXR was initially targeted at the Linux source code, but has proved usable for a wide range of software projects. lxr.linux.no is currently running an experimental fork of the LXR software.
I can recommend Sourcetrail. Can work with a compile_commands.json. Not sure if it's still maintained, though. But it's foss and you can fork it!