How to extract results from Workspace in a wordpad document.

2 Ansichten (letzte 30 Tage)
Fotis
Fotis am 22 Jun. 2015
Kommentiert: Jan am 22 Jun. 2015
Hi everyone
I have created a program that calculates Temperatures, pressures and other values of some components in a certain process. I want to gather all these results from workspace into a document like the one I have attached below. Anyone knows how to do it? I have tried report generator but seemed really messy. Any help would be very much appreciated.

Antworten (1)

Jan
Jan am 22 Jun. 2015
You can create such files with fprintf. It is impossible to guess, which parts of the layout are essential and which are optional. But when you have the exact definition of the format, a pile of fprintf commands will create them.
A less general answer is possible if the question is more specific.
  2 Kommentare
Fotis
Fotis am 22 Jun. 2015
Ok thanks. So, I want to be able to write the name of the variable I want to the left column of the document, then the unit in the middle column of it and finally the corresponding result from Matlab workspace to the right column of the document. The rest of the text are just comments that will help the reader. Is it more specific now??!
Jan
Jan am 22 Jun. 2015
No really. What do you call "columns"? How is the "name of the variable" represented in Matlab? How do you store the values and the units? How should "the rest are just comments" be implemented?
Please post Matlab code, which creates a relevant part of the available input data. Then show us, how the text file should look like based on these data. And if this is defined exactly, e.g. the number of spaces to define a "column" and the numerical format of the values, translating this into the corresponding fprintf commands is trivial.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Variables 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!

Translated by