Solved

Posted on 2006-04-19

Hi,

There was this program in matlab which was converted to java. My problem is that I am not getting the exact results like the matlab version . For example, if I were to run it 5 iterations , it is somewhat similar..and If i were to run it for 500 iterations..the result is not really similar...

My question is that lets say I use the Java's nextGaussian, nextFloat to replace the Matlab randn,rand..

Would the result be different because I am using different languange.....

Matlab Java

randn nextGaussian()

rand nextFloat()

There was this program in matlab which was converted to java. My problem is that I am not getting the exact results like the matlab version . For example, if I were to run it 5 iterations , it is somewhat similar..and If i were to run it for 500 iterations..the result is not really similar...

My question is that lets say I use the Java's nextGaussian, nextFloat to replace the Matlab randn,rand..

Would the result be different because I am using different languange.....

Matlab Java

randn nextGaussian()

rand nextFloat()

8 Comments

The methods you are using are random number generators.

So the results may not be the same.

If you can tell more details abt your class requirement then we can help you

cheers

For example,in Matlab i use rand, but in java is nextFloat()...both are random generators...but would the values produced by the exact same...i know that if it is random generators, it is not going to produce the values at that same time..

I mean lets say Matlab produces value 0.789 and the number of times it produces it would be different than java right ?? pls advice..

I guess not.

>> I mean lets say Matlab produces value 0.789 and the number of times it produces it would be different than java right

I think so.

By clicking you are agreeing to Experts Exchange's Terms of Use.

Title | # Comments | Views | Activity |
---|---|---|---|

Annotation to do Dependency injection in spring | 3 | 30 | |

sameEnds challenge | 25 | 55 | |

array220 challenge | 8 | 30 | |

strCount chalenge | 3 | 34 |

The viewer will learn how to implement Singleton Design Pattern in Java.

Join the community of 500,000 technology professionals and ask your questions.

Connect with top rated Experts

**8** Experts available now in Live!