c2m

This code helps user converting c code style to m file style

You are now following this Submission

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 (2026). c2m (https://www.mathworks.com/matlabcentral/fileexchange/28544-c2m), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.1.0.0

printf ==> %printf

1.0.0.0