Open junxu-ai opened 7 years ago
Overall, it's a wonderful project! However, for Python users, some syntax may be confused following matlab rules.
FYI Some of these functions are implemented at: https://github.com/sendos/matlab_utils_for_python Currently supported and easily used: ischar, datenum, datestr, isempty, fopen, fclose, fprintf, sprintf, size, find, regexprep, regexp, regexpi, randn, rand, ones, zeros, error, length
The “Matlabic” philosophy has been used.
‘Figure’ is implemented in: https://github.com/sendos/javascript_plots_from_python This is a library that provides access to Matlab-like functions for easily creating javascript plots from within Python. Quote: “The currently supported plotting functions are:
figure, clf, plot, title, xlabel, ylabel, grid, hold, legend, close These functions are to be used with
output_to_flot, output_to_nvd3, output_to_matplotlib in order to visualize your plots.
This library works with the matlab_utils_for_python library which also provides access to several Matlab-like functions and syntax, such as:
Matlab-like arrays, which allow 1-based indexing and also Matlab-like slices x = marray(some_list) y = x[1:3] z = x[1:2:end] Matlab-like ranges for x in mrange[1:3:10]: fprintf('%d\n', x) “ End Quote
some functions may be easily added/translated in smop, e.g.,
zeros matlab: zeros(10,10); python zeros((10,10))
find --> nonzeros
figure --> figure()
legend('a','b') -->legend(['a','b'])
5 [A, B] --> c_[A,B] (don't use cat)
6 disp() --> print()