View code generation readiness issues , c code generation from Matlab function

2 views (last 30 days)
Hi guys, 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". The following basic MATLAB comments are not supported while generate the C code 1.input, 2.cell2mat, 3.xlsread, etc.
So can you guys please tell instead of these comments.?
Thanks Murugan

Accepted Answer

Walter Roberson
Walter Roberson on 26 Apr 2017
The appropriate replacement for input() is going to depend upon how your code is getting its input. fgets() (followed by removing the line terminator) and getline() are possibilities if you are working with a stream input; gets() for unbuffered input. However, if you are generating for hardware, the hardware might not have streams or files or stdin and you might have to use a completely different kind of input.
xlsread() has no replacement in standard C or C++. You would need an external library -- presuming that the hardware you are using has a file system at all.
Instead of cell2mat, you should create a 2D array of the proper size and copy out of the cell array into the 2D array.
  2 Comments
Murugan C
Murugan C on 28 Apr 2017
Hi Walter, I tried whichever you said syntax, that also getting same issue. In real time, I want give input through key board and will process it. so can you please help me? Thanks
Walter Roberson
Walter Roberson on 28 Apr 2017
You have not indicated what your target hardware is. A lot of target hardware does not have a keyboard as such -- it is more likely to have buttons for input.

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB Coder in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!