Borrar filtros
Borrar filtros

Large matrix minimization over another matrix

3 visualizaciones (últimos 30 días)
Abdullah Fahim
Abdullah Fahim el 16 de Ag. de 2015
I have a function in the form of A = X + W .* Y where all of the variables are (M x N) matrices.
I want to minimize norm(A) over W such that the elements of W follow the equation: W(m,n) = W(m,n-1) + P(m,n)
With the help of some experts in internet, I come to the point that I have a running code. However, the code works for small M, N. Whenever I try with M,N in the range of 400-500, the whole thing hangs.
If anybody can suggest any optimization. Thanks.
M = 256;
N = 470;
X = rand(M, N);
Y = rand(M, N);
P = rand(M, N);
P(:,1) = 0;
P = cumsum(P,2); % convert to cumulative matrix
W =@(x,n) repmat(x(:), 1, n) + P; % Construct W
A =@(x,n) X - W(x,n) .* Y; % Construct Cost function
y = fminsearch(@(y) norm(A(y, N)), rand(M, 1));
w = W(y, N); % final result

Respuestas (0)

Categorías

Más información sobre Mathematics and Optimization en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Community Treasure Hunt

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

Start Hunting!

Translated by