Filter löschen
Filter löschen

Export dataset to excel file

9 Ansichten (letzte 30 Tage)
farheen asdf
farheen asdf am 10 Nov. 2015
Bearbeitet: farheen asdf am 10 Nov. 2015
Hi. I want to export a dataset to excel file. The dataset is of 1x27 cell. using the export gives the following error.
export(ds,'XLSFile','hospital.xlsx')
Undefined function 'export' for input arguments of type 'cell'.
Error in feture_loop (line 16)
export(ds,'XLSFile','hospital.xlsx')

Antworten (1)

Adam Barber
Adam Barber am 10 Nov. 2015
The error indicates that "ds" is a cell, and not a "dataset" variable. A dataset has a specific definition within MATLAB.
Take a look at xlswrite.
  1 Kommentar
farheen asdf
farheen asdf am 10 Nov. 2015
Bearbeitet: farheen asdf am 10 Nov. 2015
I have tried xlswrite but it also gives errors. My complete code is this. I wanted to create a dataset not cell. Can you please tell me where I made a mistake? Thank you.
fdir=fullfile('C:\Users\user\Desktop\BRATS-1 JPG');
for AT = 1:27
filename=fullfile(fdir,sprintf('BRATS_HG000%d_T2.jpg',AT));
if exist(filename, 'file')
I1 = imread(filename);
Im{AT} = I1(:,:,1); % im1=rgb2gray(image1);
GLCM{AT} = graycomatrix(Im{AT},'Offset',[2 0;0 2]);
fc{AT} = GLCM_Features1(GLCM{AT},0);
ds{AT}=struct2dataset(fc{AT});
end
end
export(ds,'XLSFile','hospital.xlsx')

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by