Hi,
I want to use functions from the TISEAN package in Matlab and I've tried to implement this as suggested here:
Say I wanna apply the TISEAN function "rms" to a vector of doubles, called "x". Here's what I do:
tiseanPath = 'C:\TISEAN\Tisean_3.0.0\bin\'
system([tiseanPath,'rms -a x'])
When I run these lines I get an error message saying "Cannot open input file x". What am I doing wrong here?

 채택된 답변

Walter Roberson
Walter Roberson 2012년 12월 31일
편집: Walter Roberson 2012년 12월 31일

1 개 추천

You need to write the content of the vector into a file, and then you need to name that file where you have "x" on the system() command line.
For example,
tismean_file = 'tismean_input.txt';
xv = x(:);
save(tismean_file, 'xv', '-ascii');
result = system( sprintf('%srms -a %s', tismeanPath, tismean_file) );
The result will probably be in the form of text.

댓글 수: 8

dave
dave 2012년 12월 31일
I see, thank you...and that's the one and only possibility of passing the array to the function?
From time to time people ask whether there are interfaces to program A or program B. We are command line purits so we don't need such interfaces.
I have also checked the command line options for "rms" and I see that there is no option for giving the inputs on the command line itself instead of in a file.
Glancing around a bit, I see that people have created interfaces of some kind for R and for Python.
The code is all under Gnu Public License, so if you wish you could edit the source to create ways to call the routines directly from MATLAB, passing in binary values. I did not examine the source to get an idea of how much work that would be.
dave
dave 2012년 12월 31일
편집: dave 2012년 12월 31일
I just found an m-file that wraps TISEAN functions. As far as I can tell it also creates text files for the input and output. Any suggestions how to modify this m-file so that the created text files are automatically deleted again right after the computations are done?
The second last line of that .m is
%delete (outfn);
Remove the % to leave
delete (outfn);
dave
dave 2012년 12월 31일
I'm still pretty new to Matlab, but I admit that I could have figured that out myself ;) Thank you very much for your help, Walter...
Ashwani Gupta
Ashwani Gupta 2014년 5월 1일
Hi Dave or Walter- I am trying to do the same thing as above. I have 2 questions- What formats of data can TISEAN from Matlab read? I was able to use the choose command from TISEAN from within MATLAB to read my data to a stdout. How do I run different TISEAN functions on this data? Could youhelp explain the code above suggested by Dave to read in the data. Sorry, I am new to MATLAB. Thanks. system([tiseanPath, 'choose G:\Modeling\346561.csv']);
TISEAN 3.0.0 (C) R. Hegger, H. Kantz, T. Schreiber (1998-2007)
C:\cygwin\Tisean\Tisean_3.0.0\bin\choose: Choose columns and sub-sequences from a file reading from columns 1 opened G:\Modeling\346561.csv for input 35 values read from file: G:\Modeling\346561.csv writing to stdout writing to stdout 35 values written to stdout 12.50000 12.70000 .. . . . . . . . . . . . 11.70000 12.20000 12.20000
dave
dave 2014년 5월 2일
Hi Ashwani, I'm sorry to tell you that I stopped using TISEAN (from Matlab) a long time ago, so I can't really help you with your question. Hopefully another user can give you the answers you're looking for. (If not, you could give it a try at stackoverflow.com)
Ashwani Gupta
Ashwani Gupta 2014년 5월 5일
Dave.do you still use TISEAN- maybe from the command line interface?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Data Type Conversion에 대해 자세히 알아보기

질문:

2012년 12월 31일

댓글:

2014년 5월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by