vectorize for loop while a matrix should be splited inside the loop

1 visualización (últimos 30 días)
Hi guys, I want to vectorize this for loop but not much progress unfortunately. I appreciate your helps in advance.
for j = 1 :j
MIxy(j)=kernel(X(j,:),y);
end
where kernel is a function which receives two vectors and calculates their kernel value. the X is an n by m matrix. I wanna calculate the kernel of each row of the matrix X with matrix y can save it in MIxy.
Many thanks
  2 comentarios
Darshan Ramakant Bhat
Darshan Ramakant Bhat el 6 de Mzo. de 2017
How are you calculating the kernel of two vectors. You can apply vectorization if kernel function can directly handle the matrices. Please specify your kernel() function.
Regards
Darshan Bhat
KSSV
KSSV el 6 de Mzo. de 2017
You will not get help unless kernel function known to us.

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 6 de Mzo. de 2017
for j = 1 :j
MIxy(j, :)=kernel(X(j,:),y);
end

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by