Need help changing a function to delete columns instead of rows

2 次查看(过去 30 天)
I found a function online that can import data into google sheets and it has a way to delete rows in the file but not columns. I looked through and unable to identify what part of the function is even responsible for deleting rows, so I haven't been able to figure out how to make it delete columns. I know its a bit of work, but if anyone is able to look at it and figure it out, that'd be very helpful!
This is the function
  2 个评论
dpb
dpb 2021-7-13
"what part of the function is even responsible for deleting rows, "
That certainly doesn't seem to be hard to track down...
% check if this is a delete row operation
if isempty(d)
...
status = deleteRows(spreadsheetID, sheetID, sheetpos, aSheets);
...
The deleteRows function is internal function within the whole mess of all the code that is all strung together in one file.

请先登录,再进行评论。

回答(1 个)

Jayant Gangwar
Jayant Gangwar 2021-7-13
It seems to me you are trying to find a way to delete columns while importing data into google sheets.
The function mat2sheets(spreadsheetID,sheetID,pos,d) has 4 input arguments where the first two are the identifiers of the respective sheets where as the 3rd argument specifies which cell do you want to start writing your data d. Now if you will give an empty array d as an input then this function will automatically delete the rows given in pos, for examples if pos=[2 10] , d=[] , then rows 2-10 will be deleted.
To delete column you can transpose your input data and use the above method to delete the rows.

类别

Help CenterFile Exchange 中查找有关 Graphics Object Programming 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by