def matrixto(options)
      @sheets.each_with_index do |sheet, i|
        if sheet[:cells].empty?
          m=Sheet.build(0,0)
        else
          m=buildsheet(sheet, options)
          if options[:copymerge]==true
            sheet[:mergedcells].each do |mc|
              a = mc.split(':')
              x1=x(a[0])
              y1=y(a[0])
              x2=x(a[1])
              y2=y(a[1])
              mrange=m.minor(y1..y2, x1..x2)
              valuecell=mrange.to_a.flatten.compact[0]
              (x1..x2).each do |col|
                (y1..y2).each do |row|
                  m, valuecell = mergevalues(m, col, row, valuecell)
                end
              end
            end
          end
          m.name=@sheets[i][:name]; m.sheetId=@sheets[i][:sheetId]; m.relationId=@sheets[i][:relationId]
          @sheets[i]=m
        end
      end
    end
def matrixto(options)
      @sheets.each_with_index do |sheet, i|
        if sheet[:cells].empty?
          m=Sheet.build(0,0)
        else
          m=buildsheet(sheet, options)
          if options[:copymerge]==true
            sheet[:mergedcells].each do |mc|
              a = mc.split(':')
              x1=x(a[0])
              y1=y(a[0])
              x2=x(a[1])
              y2=y(a[1])
              mrange=m.minor(y1..y2, x1..x2)
              valuecell=mrange.to_a.flatten.compact[0]
              (x1..x2).each do |col|
                (y1..y2).each do |row|
                  m, valuecell = mergevalues(m, col, row, valuecell)
                end
              end
            end
          end
          m.name=@sheets[i][:name]; m.sheetId=@sheets[i][:sheetId]; m.relationId=@sheets[i][:relationId]
          @sheets[i]=m
        end
      end
    end
Returns an array of Matrix objects.
 For each sheet, matrixto first checks the address (xlcoords) of the
 last cell in the cellarray, then builds a *nil*-filled Matrix object of
 size *xlcoords.x, xlcoords.y*.

 The matrix will then be filled with Cell objects according to their coordinates.

 If the *copymerge* parameter is *true*, it creates a submatrix (minor)
 of every mergegroup (based on the mergedcells array relative to the actual
 sheet), and after the only meaningful cell of the minor is found, it is
 copied back to the remaining cells of the group. The coordinates (xlcoords)
 of each copied cell is changed to reflect the actual Excel coordinate.

 The matrix will replace the array of cells in the actual sheet.
 @param [Hash] options
 @return [Matrix] a Matrix object that stores the cell values, and, depending on the copymerge parameter, will copy the merged value
  into every merged cell