image thumbnail

c2m

version 1.1.0.0 (2.98 KB) by Hyoung-Sik Choi
This code helps user converting c code style to m file style

376 Downloads

Updated 25 Aug 2010

View License

batch process

% if { if
% } end
% else { ==> else
% } end

% end
% else ==> else

% 'else if' ==> 'elseif'

% 'int' ==> '//int'
% 'double', '//double'

% void (a, %void (a,
% b) ==> % b)

% '#' ==> '//#'

% /* % /*
% * ==> % *
% */ % */

% '//' ==> '%'

% for(i = 0; i < 6; i++) ==> for i = 1:6 %(i = 0; i < 6; i++)
% for(i = 0; i <= 6; i++) ==> for i = 1:7 %(i = 0; i < 6; i++)

% [0] ==> (1)
% [0][0] ==> (1)(1)

% '(1)(1)' ==> '(1,1)'

% '!' ==> '~'

% 'fabs' ==> 'abs'

% x = 3*4 ==> x = 3*4 ...
% +5; +5;

Cite As

Hyoung-Sik Choi (2022). c2m (https://www.mathworks.com/matlabcentral/fileexchange/28544-c2m), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2008a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!