12-16-2008 10:41 AM - edited 12-16-2008 10:43 AM
Nghtcrwlr wrote:Thnx for your help. I was not aware of the indexing stuff.. now it wrks. but still there is some difference in final answer...
for example suppose there is only 1 value of r ; r = 3. and theta = 90,180,270,360
SO complex numbers should be when r=3 and theta =90 (1.5708 rad) ----->0+3i . the Re part of the answers is different in two cases. See attachmenet
I think since it is anyway zero, that difference doesnt affect, right? What could be the reason for that difference in results?
Since it is nearly impossible to enter multiples of PI manually wilth full DBL precision, you should maybe do the input in degrees instead and convert to radians in the code.
You should also right-click the indicator and change the display format to something reasonable, e.g. 3 decimal digits as I have done. In automatic formatting (default), you'll get e-format if the values are sufficiently close to zero.
12-16-2008 11:47 AM
Hello altenbach...
Thankyou very much. I made it already.. changed the figure to 3. now its wrking.
I have another question regarding 2d array.
I am having a 2D array with values. ( see figure) I need to take the first value of the array (index 0,0)for the first time and then elemnt in index (0,1) and then elemnt in index (1,0) and so on ..Lets say i need to do it for many time as the size of array.in figure 6 times...I tried to do it in a for loop. but it gives me only the same value for al the 6 times the loop runs.
Can anyone help?
12-16-2008 12:09 PM - edited 12-16-2008 12:10 PM
Simply reshape your 2D array to a 1D array with a size corresponding to the product of the sizes.
Then autoindex on a FOR loop and you'll get the elements in the desired order, one per iteration intil you run out of elements. 😄
12-16-2008 12:14 PM - edited 12-16-2008 12:16 PM
hello Nghtcrwlr,
definetifly , i'am too slow...
12-16-2008 03:08 PM
Hello altenbach...
That way it worked. Thanx..
Now am getting 4 1d arrays. Now i need the first values of all those arrays together, second elements of all those arrays together and so on till the number of arrays. I tried to put an index array in a for loop. but didnt work. Any hints?
12-16-2008 03:10 PM
Hi tinnitus
Thnx for the help...actually i wanted the values in a sequence but not in time intervals.
12-16-2008 03:23 PM
Nghtcrwlr wrote:Now am getting 4 1d arrays. Now i need the first values of all those arrays together, second elements of all those arrays together and so on till the number of arrays. I tried to put an index array in a for loop. but didnt work. Any hints?
Autoindex all four arrays into the same FOR loop.
If it does not work, show us your code so we can see what the problems is.
12-16-2008 03:43 PM - edited 12-16-2008 03:44 PM
Hello ALtenbach
I have attached the code. and also what is to be done is mentiond. Now i need to take the values of first column of this array and take each elements and perform some calculations. and so on for the next columns the same.... Please help me!
Thnx
12-16-2008 04:15 PM - edited 12-16-2008 04:16 PM
You really should do a few tutorials first. Simplify!!!
Here's a quick draft on how it could look like.
12-16-2008 04:43 PM - edited 12-16-2008 04:44 PM
Hello Altenbach
I have modified the vi as u mentioned. The "processing" which i mentione dis as below: the output of the for loop ( as in the attachmenet u posted "Process columns PNG") is a two 2D arrays. One array containing the real part and the other imaginary part. Both arrays are shown in attahment.Now i want to take the values of array 1> column 1 >element 1 and array 2>colum 1>elemnt 1 i.e as shown in attahment [(0,2).(1,2) (1,1),(0,1)] ... Second colum of both arrays (1,3)(2,3)(2,2)(1,2).. and so on.. these values together make an index number for an array. I want to use these index numbers to exract ements from an array.
Hope you understood the problem.