12-10-2012 02:28 PM
Hi ,
I need to make this simulation of sensor network nodes energy levels . As the node energy decreases its corresponding spot on grid changes its color. I would like to plot each node on a grid defined by node's X and Y values . I also want to graphically color each node in gray -scale , so that as the energy value lowers the color dims.I have attached the representation of nodes on a gray scale grid. how acn i draw this grid and how can i periodically change its color as energy values changes.
Please, provide me with the starting point and clues 🙂
thanking you in advance
SDI
Solved! Go to Solution.
12-10-2012 08:43 PM
Take a look at the intensity chart examples under "Help...Find Examples..."
12-11-2012 05:32 PM - edited 12-11-2012 05:36 PM
I have looked at the example and for a a newbie its complicated ... I have worked with simple file read and write etc.
I have a file in which i have three columns
Xaxis Yaxis Energy
0 0 200
0 1 250
5 3 500
6 3 490
Now i want to plot energy value corresponding to x,y coordinates (since values are logged in in random fashion , not by an arraned array format) on Intensity chart grid
Can you please guide me with suitable blocks i should use for sorting such data ?
I am waiting for the help
Thanks alot
12-11-2012 11:10 PM
@ssddii wrote:
I have looked at the example and for a a newbie its complicated ... I have worked with simple file read and write etc.
I have a file in which i have three columns
Xaxis Yaxis Energy
0 0 200
0 1 250
5 3 500
6 3 490
Now i want to plot energy value corresponding to x,y coordinates (since values are logged in in random fashion , not by an arraned array format) on Intensity chart grid
Can you please guide me with suitable blocks i should use for sorting such data ?
I am waiting for the help
Thanks alot
Then look at a 3D graph. And which is it you want to do? Plotting or sorting?
12-12-2012 02:02 AM
If i can directly map my energy value for each coordinate set on a 3D graph like
0,0 location has corresponding energy value
then i dont need to sort ..
I am asking for sorting as my data is logged randomly
How can i plot intensity (energy value) of the x and y coordinates easily
12-12-2012 02:07 AM
Sorry, but all your examples are already sorted. Do you mean you get some random x,y,z point? What do you mean by "logging data randomly"? Please post some code to show what you are trying to do.
12-12-2012 02:22 AM
What i want to do is that since i get randomly logged values like
x y intensity
1 1 8
1 0 4
0 0 1
0 1 3
I want that when i have arranged columns
0 0 1
0 1 3
1 0 4
1 1 8
so that i directly take intensity column
1 ----------------> corresponds to 0,0 pixel on intensity graph
3
4
8
and reshape my array accordingly to map
so i use reshape array of row size 2 and column size of 2 in figure
12-12-2012 02:52 AM - edited 12-12-2012 02:52 AM
So you should sort the array then. You can put each X, Y and Z values in a cluster (in that order) building an array of clusters, then use the Sort Array function on the array of clusters. Then unbundle the values and write to your intensity graph. No need to reshape.
12-12-2012 03:06 AM
Bill
Can u show me an example code ? It would b nice of u ?
12-12-2012 03:47 AM
Something like this:
You can substitute the constant 2D array with your data from file. I assumed X,Y,Z(energy).