Convert norm Matlab Function to C

When use Matlab, I have use “norm” function. I have created a simple C code to convert this norm Matlab function. Please look code below : #include <stdio.h> #include <math.h> #define ABS(a) (((a) < (0)) ? (-a) : (a)) double norm(double *x, int nx, char *p) { double xout; double tmp1; double dp; int btype, [...]

C/C++ : Convolution Source Code v.2

I have created a code to compute convolution from my previous post : C/C++ : Convolution Source Code. That code compute convolution from two vector. Matlab have parameter to get size of the ouput data from convolution process. If you check at Matlab documentation, we can set convolution process by “full”, “same” and “valid”. So, [...]

C/C++ : Get List Files in Directory

I have a problem when want to get list of files in directory or get list of directory and subdirectory using C++. So, I have try to research this problem and get a simple method using dirent library. Please check below code to get list of files in directory or get list of directory and [...]

C++ : Convert fileparts Matlab Code

If you use Matlab, we can get pathname, filename and extension from input full string path. How if we want extract dirname, filename and extension in C++ ? I want to get pathdir, filename and extension from input string. I have created a simple code how to extract path, filename and extension from fullpath string [...]