The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Looping over columns using X-function fft1

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Nilsdalby Posted - 03/16/2010 : 3:11:59 PM
Hi

Im using originpro 8.0 SR6 on a windows xp platform.

A seemingly minor problem: How can i loop over all columns in a sheet and perform a fft on each column, using the x-function fft1 ? Note, the X-function fftonmultiplecolumns is named in the help but not yet defined.

Ive tried variations over A-C:

A) loop(j,2,ncols){fft1 ix=(j);};
B) for(ii=2;ii<ncols; ii++){fft1 ix=col(ii);};
C) for(ii=2;ii<4;ii++){fft1 ix=($(ii));};

I further want the result (power) to go to one sheet and to write specifications as to how the fft is performed (graphs, phase, unwrap etc.) which should count for all columns.

Suggestions are welcome, thanks

4   L A T E S T    R E P L I E S    (Newest First)
nguyenphucuong280193 Posted - 12/26/2014 : 10:07:26 PM
Hi Nilsdalby,

I have a very similar problem, however with an x-function requiring 2 input arguments. What's the right syntax here:

loop(ii,2,15){
differentiate iy:=(1,ii) oy:=(17,ii+16);
}
is obviously wrong, but how to do it right?

schneide Posted - 12/11/2014 : 04:45:09 AM
Seems like I found out myself, thanks to the solution to above posting

Here it is:

loop(ii,2,15){
differentiate iy:=(1,$(ii)) oy:=(17,$(ii+16)) ;
}

I thought I had tried this before and it didn't work. Obviously I had made a different error at the time

Giselher
schneide Posted - 12/11/2014 : 04:32:12 AM
Hi,

I have a very similar problem, however with an x-function requiring 2 input arguments. What's the right syntax here:

loop(ii,2,15){
differentiate iy:=(1,ii) oy:=(17,ii+16);
}
is obviously wrong, but how to do it right?

Giselher

Giselher
greg Posted - 03/16/2010 : 4:05:54 PM
There are syntax errors in each of your looping examples which are corrected here:
// ncols is a property of wks
// don't forget to use ':=' and not just '='
// col( ) function cannot be used with variables
loop(j,2,wks.ncols) {fft1 ix:=$(j);};
for(ii=2;ii<wks.ncols; ii++){fft1 ix:=wcol(ii);};
for(ii=2;ii<4;ii++){fft1 ix:=($(ii));};

For examples of what to do within the loop, see
http://wiki.originlab.com/~originla/wiki/index.php?title=LabTalk:Signal_Processing#Compute_Basic_Statistics_on_FFT_Result

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000