Skip to main content
Filter by
Sorted by
Tagged with
2 votes
1 answer
3k views

I'm trying to generate C code for a simple function Matlab funciton: function[] = myfunc() %#codegen fprintf('Executing myfun\n'); fid = fopen('file_created_by_myfun.txt','w'); fwrite(fid,'This is ...
Mefitico's user avatar
  • 1,176
-1 votes
1 answer
84 views

Given a Differential Equation in matrix form: f = @(t,y) [(a*y(1) + b*y(2)); (c*y(1) + d*y(2))]; a=-2; b=-1; c=1; d=-4 Solutions to my differential equation problem are x(t)= e^(-3t) (t+1) y{t)= e^(-...
Mary A. Marion's user avatar
1 vote
1 answer
618 views

I have a C++ dll with a header file that is refrencing some generated (Matlab coder) anonymous structs. I am trying to forward declare theese structs in order to avoid including more than the main .h ...
Håkon Seljåsen's user avatar
4 votes
1 answer
400 views

I have a MATLAB code shown in below. I am trying to convert this code to C code using MATLAB Coder but I encountered an error. Expected either a logical, char, int, fi, single, or double. Found an ...
theGuardianDevil's user avatar
1 vote
0 answers
353 views

I tried to use a MATLAB coder compiled C++ library in vs 2017 but encountered the error below: 1>test_cv_2.lib(test_cv_2.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '...
kwc's user avatar
  • 21
0 votes
1 answer
229 views

I've trained a simple neural network that just multiply 4 numbers and gives 1 number as an output. ( output(x0) = in1(x0)*in2(x0)*in3(x0) *in4(x0)). or description: My neural net has 4 inputs, and ...
temp1445's user avatar
1 vote
1 answer
395 views

Generated C++ code from MATLAB for converting an image to grayscale, using MATLAB Coder. While compiling it on Dev C++ it shows error- undefined reference to rgb2gray_tbb_real64 One of the Generated ...
Ritwick Mohan's user avatar
2 votes
1 answer
343 views

I use Matlab coder to generate C code of the following function: function [out] = myresample(in) out = resample(in,4644,1000,10); end and generate the code by codegen myresample -args {coder....
Zhenjie Zhao's user avatar
0 votes
1 answer
343 views

I have an existing dll with multiple functions, let's call it mylib. I decided to use matlab coder to help me write my c-files. These c-files are compiled and linked to generate mylib using VS 2015. ...
umz's user avatar
  • 59
1 vote
1 answer
236 views

I have a DLL file, generated by MATLAB Coder, that contains function Adjust. This functions calls for few outer functions written in outer .m files, e.g PulseFindAdapt: function [Indexes,...
Alexey Abramov's user avatar
2 votes
1 answer
227 views

Hi I am trying to use C files in MATLAB through MEX-files but so far no luck. I followed the tutorial shown in this link: https://uk.mathworks.com/videos/integrating-matlab-into-your-cc-product-...
Leo's user avatar
  • 107
0 votes
1 answer
350 views

I am using Matlab coder to port code to C, e.g. for the next function: function sum_out = my_sum( x ) sum_out = 0; for i=1:size(x,1) sum_out = sum_out + x(i); end end The generated C code is: ...
Luis's user avatar
  • 127
0 votes
2 answers
932 views

I am using MATLAB coder to generate code which deals with complex numbers. The default typedef for the complex type generated by MATLAB is: typedef double real_T;//real number typedef struct { ...
Benny K's user avatar
  • 2,107
0 votes
1 answer
317 views

I write a matlab function that calculates entropy of gray scale image: "score=score_entropy(image)" then use matlab coder to convert it to c++ c++ code: #include "mex.h" #include "math.h" #include "...
samar's user avatar
  • 43
3 votes
1 answer
1k views

I have written a matlab function to calculate entropy of image "ent=entropoy(image)" and convert it to c++ function by matlab coder. I do some calculation at ent in c++ file then try to convert all c+...
samar's user avatar
  • 43
1 vote
1 answer
3k views

I'm going to convert a MATLAB code "full of operations on matrices " to C++ ,I'm not sure if MATLAB coder would generate an efficient C++ code.Is it better to convert it by hand although it's so time ...
MAh2014's user avatar
  • 147
0 votes
1 answer
82 views

I've been working on creating c code with Matlab-coder. I have a function called melfunction that gives an error for line 20 of the code below. function [ c ] = melfunction( x ) bank=melbankm(24,...
Cedrick Baker's user avatar
0 votes
0 answers
598 views

I have a problem. MATLAB Coder doesn't work properly with one of my projects. At Check For Issues state it generates error "MEX build failed". But it doesn't generate any error message. Target Build ...
DIB's user avatar
  • 1
0 votes
1 answer
302 views

I have trouble in importing the generated code of matlab coder in android studio. Can someone help me in importing C? Screenshot of Folder with the .h and .c files When Matlab generated the C code, ...
Aloy John's user avatar
2 votes
0 answers
39 views

I have a Problem in Matlab Coder. So, Im trying to short a vector with a variable. [aa,a] = min(array(:)); idx=single(a(1,1)); b= c(1:idx,1); Error: Could not determine the size of this expression. ...
dangerdan123's user avatar
2 votes
0 answers
772 views

I have an extrinsic function that returns an mxArray through webread(). This mxArray should actually be a struct, so that I can access it and read the data in it. The problem is that it has a dynamic ...
njoye's user avatar
  • 368
0 votes
1 answer
382 views

I wrote a GUI in matlab using GUIDE and I am using a data structure that is saved as a .mat file in the local directory of the matlab application. the .mat file is used to transfer variables between ...
Hamza 's user avatar
0 votes
0 answers
1k views

I've created a matlab model with intentions to use it for code generation, specifically with the PLC coder. The model is basically the example discrete PID block with the error calculation included, ...
DrTarr's user avatar
  • 962
0 votes
0 answers
339 views

I take an image using Microsoft Kinect. But all time canny edge detector missed that line. I don't know why? how can I detect this line? I attached here raw depth image & output of canny. Don't ...
sufian ahmed's user avatar
0 votes
0 answers
252 views

Apparently slbuild has severe limitations on the size of arrays that it supports. MATLAB Coder gives me options to convert those to dynamic memory. I don't see how to do that with 'slbuild'. However, ...
Brannon's user avatar
  • 5,422
1 vote
2 answers
1k views

I have a MATLAB script that contains a csvread call to read in data from a csv file. Now I'm trying to compile my MATLAB script into C using MATLAB Coder. However, csvread is not a member of the ...
ChubbyRuby's user avatar
0 votes
1 answer
82 views

When I try to convert a Matlab program as a group which includes several functions to C++ program by Matlab coder app, I get a error says this: enter image description here.And variable calc is a ...
Perry_W's user avatar
  • 403
3 votes
2 answers
271 views

I have been generating a C function from Matlab Coder environnement in order to implement it in an other software called MAX/MSP. I'm trying to make sense of it, thanks to my poor level in C ...
Vic Tor's user avatar
  • 85
1 vote
0 answers
234 views

I've Converted Some Matlab Code to C++ using Matlab Coder Tools. I have declared 2 arrays like This: emxArray_real_T *overflowIF emxArray_real_T *overflowIFTemp overflowIF = ...
ali ghaffari's user avatar
0 votes
0 answers
94 views

I am using a optimization toolbox in Matlab R2016a. But it runs very slow. I find that the main reason is the sparse matrix indexing operation when the size of sparse matrix becomes more than 100000. ...
WZhao's user avatar
  • 333
0 votes
1 answer
430 views

Hi I'm trying to export "the default code" that is automatic generated from the Registration Estimator app within MATLAB to C++ using the MATLAB Coder tool. This is an sample code I ...
flor1an's user avatar
  • 990
0 votes
1 answer
297 views

I want to draw a vertical line in Matlab upon the concurrent horizontal lines and show the coordinates where the vertical line intersects the horizontal lines.I give a figure here, I want to write a ...
Mohammad Yakub's user avatar
1 vote
1 answer
465 views

I want to generate a c++ code for DCT function using Matlab coder. I wrote this simple function and tried to convert it to c++. function output_signal = my_dct(input_signal) output_signal = dct(...
M.H's user avatar
  • 21
0 votes
1 answer
378 views

I got some issues while generate the 'C' Code from Matlab Function.Issue like this "Unsupported MATLAB Function calls" & "Code generation tools may fail unless the issues listed below are fixed". ...
Murugan's user avatar
0 votes
0 answers
99 views

in matlab while compiling to c code imcrop failed to run. is there is any alternative method or any way to suppress? I am using Matlab2016a. Below is code snippet: if ~isempty(bbox); bbox = bbox(...
Harshal Zope's user avatar
  • 1,586
0 votes
0 answers
306 views

i have make a standalone application with Matlab Compiler. Now i want to run this application on my Raspberry pi (model 3b). Is this possible? This application is just a GUI to calculate some values.
selima's user avatar
  • 5
0 votes
2 answers
66 views

I have a matrix 200 *10 having values between 100 and 150 and I want to have values of between [0 1] that's it. I know one way of doing is to divide it by max value but I want to know any other way i....
Shane's user avatar
  • 144
0 votes
0 answers
84 views

I have built the following function: function [obs,dw,rot] = myfun(T,obs,dw,dt,rot) if rot == 0 v = (0:dt:T(1)-dw); obs{1} = v./T(1); dw = (dt+v(end)-T(1)); for i = 2:numel(obs) ...
Ankara's user avatar
  • 452
1 vote
1 answer
1k views

I need to create standalone executable files out of .m Matlab files. I have Matlab 2016a under university license. Seem I have these options: 1) MCR 2) Matlab Coder 3) Matlab Compiler However I ...
Mona Jalal's user avatar
  • 38.9k
2 votes
0 answers
305 views

I have some matlab code that I use to generate C++ code with, using codegen. I want to check the execution time of a single function within this code. Normally I would use tic and toc but these ...
TobyHijzen's user avatar
0 votes
2 answers
437 views

I have a function that I export with the matlab coder to C++ code. In the code a matrix is loaded from a mat file. I was using: coder.load('filename.mat'); However this does not allow me to change ...
TobyHijzen's user avatar
0 votes
1 answer
308 views

I want to compile a MEX from a function that has the following code (MATLAB R2015a): function r = MyFunc(x,type) ind = randi(numel(x), 1); getInd = @getIndFixed; if strcmpi(type, 'random')...
Girardi's user avatar
  • 2,819
0 votes
1 answer
637 views

I have some code written in Matlab that I am converting into C code using Matlab Coder. I have written a C function that I want to call from the generated C code. This works, so far so good. The ...
Petur Olsen's user avatar
1 vote
1 answer
146 views

I have a fine tuned algorithm in MATLAB that operates on matrices (ofcourse). I've used matlab coder to generate c code for this algorithm and it works as expected. Here's a function call that I used ...
podon's user avatar
  • 61
2 votes
0 answers
160 views

I'm having trouble defining a vector to be unbound when i use the Coder to generate C code. I wish to have a vector of type double 1x:inf, that will later generate a pointer to a struct containing the ...
Modelo's user avatar
  • 21
0 votes
3 answers
827 views

I builded a neural net in Matlab and created a function, which uses the NN. I genereated C++ code from that function to use it on my Arduino Yun. In the Arduino IDE I first wrote #include "...
hanss's user avatar
  • 21
0 votes
1 answer
638 views

On Matlab coder I get the error "FOR loop index expressions of unknown size are only supported if they are of the form A:B or A:B:C" whenever I use for indexing a vector in a for loop, example: for e=...
Mia's user avatar
  • 507
2 votes
1 answer
350 views

I am trying to convert part of my function in matlab into c++ using coder. Coder doesn't support the function perms. I extensively use perms in my code. After looking online I found few suggestions of ...
Mia's user avatar
  • 507
1 vote
2 answers
765 views

I want to use the C-coder in Matlab. This translates an m-code to C-code. I use a simple function that adds 5 numbers. When the code is generated there are a lot of C- and H-files. of course you could ...
wietjes's user avatar
  • 65
2 votes
2 answers
2k views

Edit After going through this much effort only to produce faulty .exe files we have decide to not spend more time trying to generate the code and to instead write it ourselves. Thank you all for your ...
Rkey's user avatar
  • 720