c2m

This code helps user converting c code style to m file style
382 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 (2024). 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
Categories
Find more on Internationalization in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.1.0.0

printf ==> %printf

1.0.0.0