Borrar filtros
Borrar filtros

How to repeat the condition for two matrices having different sizes?

1 visualización (últimos 30 días)
I have two matrices of two different sizes A (61 x 61 x 1085) & B (61 x 61 x 31)
I apply my conditions to first A(61 x 61 x 31) until it reaches to the size of B.
Now I want to repeat the same conditions for next A (61 x 61 x 32:62) until it reaches to the size of B....and so on...upto A(61 x 61 x 1085).
Anyone, thanks in advance.
  5 comentarios
Jitesh Dadich
Jitesh Dadich el 26 de Abr. de 2019
Dear Jan, my apologies
Actually I want to check if the elements of A are greater than elements in B.
So we can compare the first block A(:, :, 31) with B and get a logical 3D array as output and it stores it in a matrix. Now program should check it for the second block A(:,:,32:63) with B again, and stores it in outputs......and so on..
Result should have the dimension as of A (61,61,1085).
thank you

Iniciar sesión para comentar.

Respuesta aceptada

Andrei Bobrov
Andrei Bobrov el 25 de Abr. de 2019
Editada: Andrei Bobrov el 26 de Abr. de 2019
I edited the answer.
out = A > B(:,:,mod(0:size(A,3)-1,size(B,3))+1);
  3 comentarios
Andrei Bobrov
Andrei Bobrov el 25 de Abr. de 2019
What should be the end result?
Please give an example.
Jitesh Dadich
Jitesh Dadich el 27 de Abr. de 2019
Thank you Andrei Bobrov...It worked well...

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Multidimensional Arrays 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