TAGGED: geometry, mathematical-model
- 
		
			- 
November 12, 2024 at 3:30 pm10172100207 SubscriberXmin = [80,300,30,160,10]; # D,P,H,G min Xmin = [100,400,50,20,10]; Xmax = [160,700,200,320,200]; p1(i,j) = Xmin(j) + rand*(Xmax(j) - Xmin(j)); But I want the rand(between 0 and 1)*(Xmax(j) - Xmin(j)) to be an int number, not float. 
- 
November 12, 2024 at 9:33 pmKirill Forum ModeratorHello Subscriber, 1.      Consider using the following functions, which take a floating-point argument and return an integer: ceil (rounds up), floor (rounds down), and round (rounds to the nearest integer). 2.      The rand function itself can also return an integer directly when used with 3 arguments. Please check the linked documentation for details.  Additionally, you may find it helpful to review the Ansys Optics Scripting Language section, as well as the Ansys Lumerical Scripting Course.  Best regards, Kirill 
 
- 
- You must be logged in to reply to this topic.
- 
                        
                        4167
- 
                        
                        1487
- 
                        
                        1363
- 
                        
                        1189
- 
                        
                        1021
© 2025 Copyright ANSYS, Inc. All rights reserved.
 You are navigating away from the AIS Discovery experience
You are navigating away from the AIS Discovery experience 
               
          