Error using rmdir baseDir, 's' is not a directory

I've used this code many times before but recently messed with my tmp folder when I was trying to use VBA in Excel on my Mac and now I am getting this error:
|Warning: The following error was caught while executing 'onCleanup' class destructor:
Error using rmdir
/tmp/tp4f668073_e218_424b_b147_c9542372d9ae is not a directory.
Error in xlsreadXLSX>@()rmdir(baseDir,'s') (line 130)
cleanupBaseDir = onCleanup(@()rmdir(baseDir,'s'));
Error in onCleanup/delete (line 60)
h.task();
Error in xlsreadXLSX>getXLSXData (line 126)
function [sharedStrings, parsedSheetData, range] = getXLSXData(file, sheet, range)
Error in xlsreadXLSX (line 15)
[sharedStrings, parsedSheetData, range] = getXLSXData(file, sheet, range);
Error in xlsread (line 236)
[numericData, textData, rawData] = xlsreadXLSX(file, sheet, range);
Error in TecanDataReader (line 10)
[data,rowLabel]=xlsread(filename);
> In xlsreadXLSX>getXLSXData (line 126)
In xlsreadXLSX (line 15)
In xlsread (line 236)
In TecanDataReader (line 10)
Error using xlsread (line 249)
Permission denied|
Below is my code:
%For 96 well or 384 well plates
clc
clear all
%need to enter file name as string in purple
filename='180629 Plate Reader.xlsx';
tp=30; %time point interval, in minutes
tph=tp/60; %convert to hrs
%Read data
[data,rowLabel]=xlsread(filename);
tpn=0; %Initialize: number of time points in data set
rows=0; %Initialize: rows on plate
for i=1:length(rowLabel)
if strcmp(rowLabel(i),'<>')
tpn = tpn+1;
rows = 0;
else
rows=rows+1;
end
end
[~,columns]=size(data);
%plate details
if rows==8
platetype='96 well';
[~,wellnames]=xlsread('welllabels','96well');
else if rows==16
platetype='384 well';
[~,wellnames]=xlsread('welllabels','384well');
else
platetype='unknown';
end
end
headers=0; %there are headers with column labels in data
sampledata=[];
samplerow=0;
colcount=0;
for j=1:length(rowLabel) %Go through every row in data
if (j==1) || (j==rows*(headers)+(headers+1))
headers=headers+1;
colcount=1; %Reset the column count after each header
else
samplerow=ceil((j-headers)/rows); %Corresponds to timepoint for that row
sampledata(samplerow,((colcount*columns-columns+1):colcount*columns))=data(j,:);
colcount=colcount+1;
end
end
%Add labels
time=0:tph:tpn*tph; %Time point labels
datatowrite(1,2:length(wellnames)+1) = wellnames';
datatowrite(2:length(time)+1,1) = num2cell(time');
datatowrite(2:length(sampledata(:,1))+1,2:length(sampledata(1,:))+1) = num2cell(sampledata);
% Removes the extension from filename
t = findstr(filename,'xlsx');
filename = filename(1:t-2);
%Write to file
xlwrite(['Formatted ' filename '.xlsx'], datatowrite)

1 commentaire

Stephen23
Stephen23 le 3 Juil 2018
"... recently messed with my tmp folder when I was trying to use VBA..."
"Error using rmdir /tmp/tp4f668073_e218_424b_b147_c9542372d9ae is not a directory"
What did you change using VBA? I suspect that this can't be fixed from the MATLAB end, you will need to get Excel back to the way it was.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur File Operations dans Centre d'aide et File Exchange

Produits

Version

R2016b

Tags

Commenté :

le 3 Juil 2018

Community Treasure Hunt

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

Start Hunting!

Translated by