I built a sparse matrix
A at each step as follows:
% 1 < DX < 120000 A = sparse(i,j,s,DX,DX,6*DX) b = (1, DX)
The problem that I am dealing with is a discretization problem. I have maximum 120000 nodes. Each of these nodes have special characters and I choose only the ones that meet a (previously) defined criteria. The number of these chosen ones is
DX and is completely dependent on the physical process.
I am using backslash in
x = A\b. But as the size of A could become quite big, the computational time rises drastically (more than
10e5 time steps have
DX > 6e4). As far as I know, backslash operation is already well optimized in MATLAB but I would like to know:
Would it make sense to use
codegenand convert the code to C?
Does any one know an alternative method instead of backslash, so that the computational time decreases (maybe an iterative method?)?