• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How is k=1:N expressed in JAVA

 
Elisabeth Ibeh
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How is k=1: (N+256)/2; expressed in Java.
k is the vector length.
 
Campbell Ritchie
Sheriff
Posts: 48382
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

What does that formula mean?
 
Elisabeth Ibeh
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
It is the length of the frequency vector.
 
Campbell Ritchie
Sheriff
Posts: 48382
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have already told us that. How do you work it out? Does : mean divide?
 
Elisabeth Ibeh
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48382
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10091
56
Eclipse IDE Hibernate Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Elisabeth Ibeh
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic