Yes, you can plot them all at once by padding your matrix with NaN's.
The patch documentation states MATLAB does not require each face to have the same number of vertices. In cases where they do not, pad the end of the Faces matrix with NaNs. To define a patch with faces that do not close, add one or more NaNs to the row in the Vertices matrix that defines the vertex you do not want connected. If you have just a few vectors, then you can create this matrix by hand.
If you need to combine many such vectors together, padding them with NaN's, you should be able to adapt this code to concatenate unequal-length vectors together into one matrix, padding with NaN's:
A = {[0,1,2],[3],[4,5,6],[7],[8,9]};
B = cellfun('length',A);
C = cellfun(@(v,n)[v,nan(1,max(B)-n)],A,num2cell(B),'UniformOutput',false);
C = vertcat(C{:});
0 Comments
Sign in to comment.