Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Can I write the output of a 'summary' command of a 'table'-variable to a variable ?

1 Ansicht (letzte 30 Tage)
Luisa Liboni
Luisa Liboni am 11 Dez. 2018
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
Some answers about this were posted in 2015
I am using Matlab 2017 and the hack suggested does not seem to work. I have made a local copy of the summary function and incorporated the fid into every fprinf as instructed. By doing this (suggested by Guilaume) I reveice the following error:
summarynew(tab);
Unrecognized variable name 'getProperty'.
Any help?

Antworten (1)

GT
GT am 11 Dez. 2018
I believe as of R2017b you can do the following:
a = summary(tab)
This will return a structure with the information that summary typically prints to the command window. I am on R2018b and here is a small example:
a = rand(10,1)
b = table(a,a)
summary(b)
c = summary(b)
c.a
% returns the following
ans =
struct with fields:
Size: [10 1]
Type: 'double'
Description: ''
Units: ''
Continuity: []
Min: 0.0975
Median: 0.7235
Max: 0.9649
NumMissing: 0
Would this be a reason to move to a newer release for you?
  4 Kommentare
Luisa Liboni
Luisa Liboni am 12 Dez. 2018
As I said .. I need a report.
I have to send this information, as it is printed in the screen for people who do not have matlab code knowledge.
GT
GT am 12 Dez. 2018
Following Guillaume's reasoning you could always do:
tsummary = struct2table(summary(yourtable));
writetable(tsummary,'myExcelfile.xlsx')

Diese Frage ist geschlossen.

Produkte


Version

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by