Add a dataset to an existing Steno3d resource

steno3d.addData(resource, data) adds matrix or vector data to the Steno3D resource (Point, Line, Surface, or Volume). This function first attempts to assign data to cell centers then to nodes. If the length of the data does not match either of these, this function errors.

steno3d.addData(resource, title, data) adds data to the resource with a given title string.


x = [0 1 0 0]; y = [0 0 1 0]; z = [0 0 0 1];
tris = convhull(x, y, z);
[proj, sfc] = steno3d.trisurf(tris, x, y, z, 'r');
steno3d.addData(sfc, 'Cell Center Data', rand(4, 1));


If the number of cell centers matches the number of nodes (as is the case in the example above), this function will default to locating data on cell centers. However, this can be changed programatically:

mySurface.Data{end}.Location = 'N';

and change the title accordingly:

mySurface.Data{end}.Data.Title = 'Node Data';


See also steno3d.core.DataArray, steno3d.addImage, steno3d.trisurf