Dear Octave Community

I have a struct "quaternion" with fields w, x, y and z. The fields are matrices.

Next I build a cell array "qcell" which contains quaternions.

Now I can access fields with   qcell{2}.w

However,    qcell{:}.w     doesn't seem to work.

How can I extract those fields? Thanks for every help!


function q = horzcat (varargin)

  qcell = cellfun (@quaternion, varargin, "UniformOutput", false);

  w = horzcat (qcell{:}.w);
  x = horzcat (qcell{:}.x);
  y = horzcat (qcell{:}.y);
  z = horzcat (qcell{:}.z);

  q = quaternion (w, x, y, z);

endfunction


Regards
Lukas
------------------------------------------------------------------------------

_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to