Fprintf Wavestats ?
Mike German
I have no idea how to start to tackle this, but it seems the sort of thing someone else must have solved. Ideas ?
REgards
Mike
I have no idea how to start to tackle this, but it seems the sort of thing someone else must have solved. Ideas ?
REgards
Mike
Hi Mike,
Perhaps one approach is to use capturehistory functionality.
CaptureHistory(refnum, stopCapturing )
The CaptureHistory function returns a string containing text from the history area of the command window since a matching call to the CaptureHistoryStart function.
Parameters
refnum is a number returned from a call to CaptureHistoryStart. It identifies the starting point in the history for the returned string.
Set stopCapturing to nonzero to indicate that no more history should be captured for the given refnum. Subsequent calls to CaptureHistory with the same refnum will result in an error.
Set stopCapturing to zero to retrieve history text captured so far. Further calls to CaptureHistory with the same reference number will return this text, plus any additional history text added subsequently.
My test example
returns. Not sure why the wavetstats command is at the end.
Andy
November 17, 2019 at 06:38 am - Permalink
@Mike Could you rephrase the question? I'm not understanding what you want to achieve.
November 18, 2019 at 01:45 am - Permalink
@hegedus- I thought I had documented the reason the command is at the end, but I can't find it.
The command history has quite a bit of complex code that puts the command itself into the history in the right place. You will notice that the command stays in the command line until the command has finished running successfully, and then it is inserted into the history above any printout from the command that has appeared between when you hit Enter and when the command has finished running.
I didn't wan't to try to reproduce that complicated code for CaptureHistory because all the complexity of the history would have to be reproduce with quite a bit of complexity added due to the fact that CaptureHistory can happen at any time. So CaptureHistory stores everything put into the history, but in the chronological order in which it was added to the history, not in the order in the history text.
I should perhaps clarify that in the documentation.
I added CaptureHistory for our own internal testing framework- I use it to capture curve fitting history reports so that I can test that (complicated) aspect of curve fitting. That test has more than once saved me from releasing broken curve fitting changes!
November 18, 2019 at 10:18 am - Permalink
In reply to @Mike Could you rephrase the… by thomas_braun
I am generating 11 waves 5000 points long and filling these with calculated values from a Monte Carlo style routine. I then run the routine with different start parameters. I thought that it would be useful to have an automatic way of saving the WaveStats in a text file for later reference. I thought it could be easy :-)
I think the suggested approach by Andy (hegedus) is probably to complicated for what I need. I will therefore just use internal functions to generate my own stats. Thanks for approach which I wasn't aware of and will bear in mind for the future.
November 19, 2019 at 02:56 am - Permalink
Thanks for the explanation. Have a look at Save, this allows to save waves as text or binary.
November 19, 2019 at 03:34 am - Permalink
In this case I would consider summarizing the 11 waves as a matrix (i.e. with Concatenate), then use Wavestats/PCST to obtain a labelled wave and then use Save.
If you save as text file make use of the /U flag to write the row labels to file.
November 19, 2019 at 04:53 am - Permalink
Hi,
To add to ChrLie's suggestion. You could add some data points with dimension labels to include the start parameters that you used in the monte carlo simulations. That way you have all the relevant info in one place.
Andy
November 19, 2019 at 08:12 am - Permalink
In reply to Hi, To add to ChrLie's… by hegedus
Thanks for advice - will try ideas out.
November 23, 2019 at 08:47 am - Permalink