Borrar filtros
Borrar filtros

How to pass and access an structure array in mex

2 visualizaciones (últimos 30 días)
mohsan niaz
mohsan niaz el 20 de Abr. de 2014
Comentada: James Tursa el 21 de Abr. de 2014
Hi everybody,
I am trying to pass a structure array to mex function through Matlab. I have read a lot on internet but i cannot find a simple example in form of code that can explain it. Kindly can some one explain me via a simple code. For example i am trying to pass the following structure array to a mex function.
tt = 1; for i = 1:r for j = 1:c edge(tt).row = i; edge(tt).col = j; tt = tt + 1; end end end
  1 comentario
James Tursa
James Tursa el 21 de Abr. de 2014
Are you simply trying to recover the i and j values inside the mex function? Or is there a larger context or different problem you are actually trying to solve? mxGetField followed up with mxGetScalar can do the job you have requested.

Iniciar sesión para comentar.

Respuestas (1)

dpb
dpb el 20 de Abr. de 2014

Categorías

Más información sobre Resizing and Reshaping Matrices 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