MATLAB: More efficient way to export output to Excel

export to excelxlswrite

Hello,
I am currently following this method to export the results to one Excel file:
xlswrite('C:\Users\...\Graph.xlsx',{'A' 'B' 'C' 'D'},'Sheet1','A1');
xlswrite('C:\Users\...\Graph.xlsx',PriceA','Sheet1','A2');
xlswrite('C:\Users\...\Graph.xlsx',PriceB','Sheet1','A2');
.
.
etc
There must be a more efficient way that opens the excel file only once, but I am not able to locate it. It is not really logical to write every time separately to the same file.
Any assistance is appreciated.
Thanks

Best Answer

EDIT
header={'A' 'B' 'C' };
priceA=[1 2 3]';
priceB=[4 5 6 8 9 1 0 12 15 20]';
priceC=[7 8 9 10]';
max_n=10;
tr=@(price)[num2cell(price) ;repmat({[]},max_n-numel(price),1)]
priceA=tr(priceA)
priceB=tr(priceB)
priceC=tr(priceC)
M=[header;[priceA priceB priceC]]
xlswrite('C:\Users\...\Graph.xlsx',M)