permaculture playing cards*
The moose likes Beginning Java and the fly likes How is k=1:N expressed in JAVA Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How is k=1:N expressed in JAVA " Watch "How is k=1:N expressed in JAVA " New topic
Author

How is k=1:N expressed in JAVA

Elisabeth Ibeh
Greenhorn

Joined: Apr 03, 2013
Posts: 6
Hi,
How is k=1: (N+256)/2; expressed in Java.
k is the vector length.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38436
    
  23
Welcome to the Ranch

What does that formula mean?
Elisabeth Ibeh
Greenhorn

Joined: Apr 03, 2013
Posts: 6
Thanks.
It is the length of the frequency vector.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38436
    
  23
You have already told us that. How do you work it out? Does : mean divide?
Elisabeth Ibeh
Greenhorn

Joined: Apr 03, 2013
Posts: 6
means the the length starts from 1 to (N+256)/2
I am new to Java, usually work with Matlab.
any help will be appreciated. Thanks
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38436
    
  23
Afraid I am not familiar with that algorithm.
Sounds like something for a loop. In which case you might have multiple results and they will have to go into an N‑length array.
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7677
    
  19

Elisabeth Ibeh wrote:means the the length starts from 1 to (N+256)/2

Yes, but I think what's being asked is: what is N? For the purposes of the loop is it a constant, or can it change while the loop is in progress?

Either way, assuming that the loop is working with a counter, it could easily be something like:however, 'k' could just as well be a float or a double if you need it to be.

You should also understand the difference between integer and floating-point division, because if n (and in Java, by convention, it's 'n', not 'N') is an integer type, it will behave differently from if it's a floating-point type.

Winston

Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
Elisabeth Ibeh
Greenhorn

Joined: Apr 03, 2013
Posts: 6
Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How is k=1:N expressed in JAVA