Borrar filtros
Borrar filtros

how to divide two structures?

3 visualizaciones (últimos 30 días)
Sivakumaran Chandrasekaran
Sivakumaran Chandrasekaran el 4 de Mzo. de 2013
A is a structure. B is a structure. i need to perform A/B. How to get it?
  1 comentario
Jan
Jan el 4 de Mzo. de 2013
Currently we can only guess, what the "/" operator should do for your data. Does "structure" mean STRUCT arrays? Should something happen with the fields?

Iniciar sesión para comentar.

Respuestas (2)

Walter Roberson
Walter Roberson el 4 de Mzo. de 2013
You do not. What would it even mean? What would you expect as the result of
struct('P', {5:10}, 'Q', {magic(17)}) / struct('S', {'hello'}, 'T', false(7,8), 'P', {2})
??

Azzi Abdelmalek
Azzi Abdelmalek el 4 de Mzo. de 2013
A=struct('a1',num2cell(1:10))
B=struct('b1',num2cell(11:20))
C=cellfun(@(x,y) x/y,struct2cell(A),struct2cell(B),'un',0)
C=cell2struct(C,{'c1'},1)

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by