MATLAB: Adding data into existing excel sheet from matlab

xlswrite

I have an excel sheet 'myvalues.xlsx' cosisting of 200 vectors of 127bits each. Now I want to add another vector to my excel sheet which will be placed as the 201th row without changing the existing data. How can I acheive it. Have tried xlswrite but its not working.

Best Answer

It seems that variable "mydata" is of size [1x3] but the size of the range you elected is [1x1] (i.e. a single excel cell rather than a range of cells) in
xlCurrRange = xlsheet.Range(['A' num2str(newRange)]);
% ['A' num2str(newRange)] = 'A301' since newRange appears to be the scalar 1 which is added to 300
I think that instead of 'A301' you want to have 'A301:C301' which is
xlsheet.Range(['A', num2str(newRange),':C', num2str(newRange)]);
which should capture the full [1x3] size of "mydata"
Is this it or have I misunderstood?