Answered
How do I use C++ classes in a mex file?
You can instantiate it just like you would in any other C++ file. And yes, you will need to compile that class also into the MEX...

14 years ago | 0

Answered
Use of Function Handle and fmincon in Embedded MATLAB
As Sean pointed out, here is the documentation about support for function handles with code generation - <http://www.mathworks.c...

14 years ago | 0

Answered
MATLAB appcrash when I use mxFree in S-Function
ssGetPWork(S) returns memory owned and managed by Simulink - you should not be freeing this memory in your own code. Is there a ...

14 years ago | 0

Answered
Dynamically sized outputs / work vectors using the Legacy Code Tool
What you're looking to do is output a <http://www.mathworks.com/help/toolbox/simulink/ug/br65qom-1.html variable-size> signal. U...

14 years ago | 0

| accepted

Answered
Generating Code from RTW and compiling using MSVC++ 2008 express edition
I don't know if this has been tried before, so I can't provide a link to an existing example. However, it should definitely be p...

14 years ago | 0

| accepted

Answered
MEX file debugging with MS Visual Studio
When you compile the MEX-file, did you use the mex -g option so that a debuggable binary is built? If using Visual Studio, you s...

14 years ago | 0

| accepted

Answered
Converting Matlab code to C code
To expand's on Walter's answer, your MATLAB code should look like this: function val = matc(n) val = 0; for i = 1...

14 years ago | 2

Answered
Real time workshop code generation with S-function
What is the error that you get exactly? Do you see the error even without your custom hooks? I'm think that you need at least a ...

14 years ago | 0

Answered
accessing port data types during Complilation
You cannot run this code during mask initialization, because mask initialization is actually one of the stages of the model comp...

14 years ago | 0

Answered
Mask Subsystem Parameter global using
Why not created a variable in the workspace which holds the parameter value and enter that variable name everywhere that you nee...

14 years ago | 0

Answered
can we burn directly matlab programming into PIC without using micro-C language
Almost all embedded processors only provide compiler tools that convert C code to the appropriate binary format. Unless the vend...

14 years ago | 3

Answered
Keep Simulink simulation stable
The points that you describe are for stability with respect to system dynamics - not software stability (ie. crashes). In genera...

14 years ago | 0

| accepted

Answered
plz help me out with this error..matrix dimension mismatch
IMREAD usually returns a 3-D matrix, but you are collapsing the size to a 2-D by using: [m n]=size(img1); Try: [m n...

14 years ago | 0

Answered
how to use .net assembly generated in matlab
See <http://www.mathworks.com/help/releases/R2011b/toolbox/dotnetbuilder/ug/f6010dfi6.html Programming with COM Components Creat...

14 years ago | 0

Answered
Can Accelerator work on model with algebraic loop?
Starting in R2011b, <http://www.mathworks.com/help/toolbox/simulink/rn/bs0fxnc.html#bs0f1dw Accelerator Mode Now Supports Algebr...

14 years ago | 2

| accepted

Answered
Extract state space from Simulink - Blocks without pre-programmed exact Jacobian
I don't know a lot about linearization, but here are some <http://www.mathworks.com/help/toolbox/physmod/simscape/ug/bqvy3s5-1.h...

14 years ago | 0

Answered
External DLL not working when deployed
Most likely, the DLL you are attempting to load, or one of it's dependencies were not found on the deployed machine. I would rec...

14 years ago | 0

Answered
Ability to inherit parameter size with RTW S-function target?
I suspect that this might be a product limitation - perhaps you could file an enhancement request through MathWorks Tech Support...

14 years ago | 0

Answered
Trouble with rate transition blocks and function-call subsystems in an interaction with a MATLAB embedded function
What error do you see when you put the block inside a Function-Call subsystem? I would recommend this configuration on the funct...

14 years ago | 0

Answered
Dynamically change the number of ports of a block
Have you tried setting the number of input ports based on the parameter value? For example, try something like: block.NumInp...

14 years ago | 0

| accepted

Answered
Protecting dynamic masked subsystem
You might want to generate a protected model or S-function from an unmasked version of the subsystem, and then create the mask a...

14 years ago | 0

Answered
Cant create the .ctf file using mcc command in 2009a
It is embedded into the generated binary by default starting in R2008b. If you do not want it to embedded, uncheck the Embed CTF...

14 years ago | 0

Answered
Unable to find MCR Installer in R2010a?
If you already have MATLAB Compiler installed, type the following command to locate the MCR installer: >> mcrinstaller

14 years ago | 1

Answered
Regarding XPC Target
See <http://www.mathworks.com/help/toolbox/xpc/gs/f1-9588.html#f1-13260 Test 2, Ping Target System xPC Target Ping>.

14 years ago | 0

Answered
How i edit the font of microsoft document file
From your previous question, it looks like you are already familiar with the COM API (if not, see http://www.mathworks.com/matla...

14 years ago | 1

| accepted

Answered
How i can perform file operations on microsoft document file
See the previous discussion here: http://www.mathworks.com/matlabcentral/answers/1531-word-com-writing-text-into-this-open-docum...

14 years ago | 1

| accepted

Answered
Is it possible to get a matlab to C code converter? I have a .m file that is to be used in quartus 2(fpga tool).So I need to generate the C equivalent for the code in hand.
You can use <http://www.mathworks.com/products/matlab-coder/ MATLAB Coder> to convert MATLAB code to C code automatically, but o...

14 years ago | 1

Answered
.m to .mdl
Do you want to set it on a model that is already open? If yes, you can use the <http://www.mathworks.com/help/toolbox/simulink/s...

14 years ago | 0

| accepted

Answered
Can I use Matfile LIbrary to access MAT files from C program without using mex
Yes, you can write standalone applications using the MAT-file library than can run independent of MATLAB. You just need to copy ...

14 years ago | 1

| accepted

Answered
Problem in serial communication between Simulink and Arduino
Your best bet might be to contact the author of the block library - in this case, Matt Bilsky I guess? Also, this paragraph make...

14 years ago | 0

Load more