i cannot upload the response file(excel) ; its fine while uploading the predictor
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
function [newData1] = importfile(fileToRead1)
%IMPORTFILE(FILETOREAD1)
% Imports data from the specified file
% FILETOREAD1: file to read
% Auto-generated by MATLAB on 17-Mar-2022 21:31:45
% Import the file
sheetName='Sheet1';
[numbers, strings, raw] = xlsread(fileToRead1, sheetName); %#ok<XLSRD>
if ~isempty(numbers)
newData1.data = numbers;
end
if ~isempty(strings)
newData1.textdata = strings;
end
if ~isempty(strings) && ~isempty(numbers)
[strRows, strCols] = size(strings);
[numRows, numCols] = size(numbers);
likelyRow = size(raw,1) - numRows;
% Break the data up into a new structure with one field per column.
if strCols == numCols && likelyRow > 0 && strRows >= likelyRow
newData1.colheaders = strings(likelyRow, :);
end
end
0 Kommentare
Antworten (1)
Dinesh
am 22 Dez. 2023
Hello.
The issue is that the Excel file you're trying to upload as a response isn't being accepted, possibly due to the file size or format limitations (inferred from your code). This can occur if the upload mechanism doesn't support the specific Excel file size or if the file format isn't recognized by the system's configuration. To resolve this, ensure the file conforms to size limits, check for the correct file format, and verify that your system has the appropriate permissions set for the file upload.
If needed, here's a code snippet for checking file size before attempting the upload in MATLAB:
fileInfo = dir(fileToRead1);
if fileInfo.bytes < uploadLimitBytes
% Proceed with file upload
else
error('File exceeds the maximum allowed size for upload.');
end
The following links might help you:
0 Kommentare
Siehe auch
Kategorien
Mehr zu Sequence and Numeric Feature Data Workflows finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!