How to get code in C?

조회 수: 1 (최근 30일)
Sagar Damle
Sagar Damle 2013년 4월 19일
I have a [3*8] matrix (which is matrix 'a').I take a [1*8] matrix (which is matrix 'b') from user as input to arrange the matrix 'a' as follows –
a = a(:,b)
I want to get equivalent C code for this instruction. I have MATLAB 2010a and have set compiler as‘Microsoft Visual Studio 2008’ from 'mex –setup'.
When I use 'emlc' function to get C library for this function,I get report that 'Code generated successfully'. But I am not getting C code for this instruction in 'abc.c'.
Is it a case that the function requires recursion and recursive functions are not shown by 'emlc'?
I have written this function –
function abc
a = [1 2 3 4]
b = [4 3 2 1]
c = a(:,b)
Values of 'a' and 'b' are only for instance. My aim is to get C code for
a = a(:,b).
I have verified mex file. It is running.
Also I want to suppress the files from being generated such as
rtGetInf.c, rtGetNaN.c, rt_nonfinite.h.
Can anyone tell me solutions for these 2 problems?
Thank you !
  댓글 수: 1
Kaustubha Govind
Kaustubha Govind 2013년 4월 19일
Could it be because you're not returning 'c' as the output of your function? Try changing that to:
function c = abc
a = [1 2 3 4]
b = [4 3 2 1]
c = a(:,b);
I don't believe there is a way to suppress creation of the rt_* files.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Coder에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by