Save Matlab audio output
Are you aware of cell-arrays in Matlab?

Consider the following short script-file,

    close all; clear; clc;

    x=randn(1024, 1);
    y=2+sqrt(0.5).*randn(2048, 1);

    S=[ {x}; {y} ]; size(S)

    z=[ S{1, :}; S{2, :} ];

    figure; ...
        subplot(3,1,1); ...
            plot(S{1, :}); grid on; xlim([1 numel(S{1, :})]);
        subplot(3,1,2); ...
            plot(S{2, :}, 'r'); grid on; xlim([1 numel(S{2, :})]);
        subplot(3,1,3); ...
            plot(z, 'k'); grid on; xlim([1 numel(z)]);
        shg;


Once you create a vector of cell-arrays (each cell-array will have a different length that is dependent on the duration of the silent periods), you can save it to a file.

I hope this helps.