I need h help i save value in xlsx format through push button function
Show older comments
Hi Dear Sir,
I need h help i save value in xlsx format through push button function. I hope a better code solution forwrd me thanks.
These data value want to save with new function of push button. My code is below:
data = get(handles.uitable1, 'Data');
data{1, 1} = num2str(Contrast(1));
data{1, 2} = num2str(Contrast(2));
data{1, 3} = num2str(Contrast(3));
data{1, 4} = num2str(Contrast(4));
data{1, 5} = num2str(mean(Contrast));
data{2, 1} = num2str(Correlation(1));
data{2, 2} = num2str(Correlation(2));
data{2, 3} = num2str(Correlation(3));
data{2, 4} = num2str(Correlation(4));
data{2, 5} = num2str(mean(Correlation));
data{3, 1} = num2str(Energy(1));
data{3, 2} = num2str(Energy(2));
data{3, 3} = num2str(Energy(3));
data{3, 4} = num2str(Energy(4));
data{3, 5} = num2str(mean(Energy));
data{4, 1} = num2str(Homogeneity(1));
data{4, 2} = num2str(Homogeneity(2));
data{4, 3} = num2str(Homogeneity(3));
data{4, 4} = num2str(Homogeneity(4));
data{4, 5} = num2str(mean(Homogeneity));
global AA1 AA2 AA3 AA4 AA5 AA6 AA7 AA8 meann
AA1 = Mean;
AA2 = Standard_Deviation;
AA3 = Entropy;
AA4 = Variance;
AA5 = Smoothness;
AA6 = Kurtosis;
AA7 = Skewness;
AA8 = IDM;
set(handles.edit3, 'string', AA1);
set(handles.edit5, 'string', AA2);
%set(handles.edit7, 'string', RMS);
set(handles.edit9, 'string', AA3);
set(handles.edit11, 'string', AA4);
set(handles.edit13, 'string', AA5);
set(handles.edit15, 'string', AA6);
set(handles.edit17, 'string', AA7);
set(handles.edit19, 'string', AA8);
handles.saved = data;
set(handles.uitable1, 'Data', data)
guidata(hObject, handles);
4 Comments
Rik
on 13 Jul 2022
Why on earth are you using global variables and what have you tried to actually write data to an excel file?
Tanveer Aslam
on 13 Jul 2022
Jan
on 13 Jul 2022
@Tanveer Aslam: Please answer Rik's questions for clarifications. This would allow to understand your code and to post amatching solution.
Tanveer Aslam
on 13 Jul 2022
Edited: Rik
on 13 Jul 2022
Accepted Answer
More Answers (0)
Categories
Find more on Text Data Preparation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!