Clear Filters
Clear Filters

how to get a table of energy of individual sensor node vs time?

1 view (last 30 days)
If i deploy 100 nodes in a RoI how can i get the energy level of each and every node in every second?
  5 Comments
BLESSINA PREETHI
BLESSINA PREETHI on 16 Oct 2023
Are you able to generate the energy data and facing difficulty in combaining the data in a table?
yes. especially with time sir
Walter Roberson
Walter Roberson on 16 Oct 2023
Is this a simulation question, or do you have 100 different physical sensor devices ? If you have physical sensor devices, how do they communicate with each other and with the host collecting the data? If they are communicating through some radio-based method, then are their individual signals strong enough to communicate with a single data collection node or do you need to relay signals from node to node?

Sign in to comment.

Accepted Answer

Arun
Arun on 17 Oct 2023
Hey Blessina,
Based on you reply to the comment, I understand that you are encountering challenges in consolidating the data from 100 nodes into a table.
I am providing a sample code snippet that you can use with your data for creating the table that you need.
% Random data for sample that represent Sensor nodes data
% Taking more values than the simulation seconds to give example
% I am using 2-D matrix similarly a vector can be used or combine vectors to
% make a 2-D matrix.
sampleData=ones(1000,100); % dummy data for the Sensors data.
for i=1:100
sampleData(:,i)=rand(1,1000)'; %complement to get a column vector
end
%assumptions
noOfNodes=100;
SimDuration=200; %assuming the duration to be 200 seconds
%creating table using the data
PowerdataTable=table;
time=(1:SimDuration)';
PowerdataTable=addvars(PowerdataTable,time);
%add nodes data to the table
for i=1:noOfNodes
PowerdataTable=addvars(PowerdataTable,sampleData(1:5:1000,i));%taking every 5th value as sampling frequency in the recorded sampleData is 200 ms.
end
%output table
Pow
PowerdataTable = 200×101 table
time Var2 Var3 Var4 Var5 Var6 Var7 Var8 Var9 Var10 Var11 Var12 Var13 Var14 Var15 Var16 Var17 Var18 Var19 Var20 Var21 Var22 Var23 Var24 Var25 Var26 Var27 Var28 Var29 Var30 Var31 Var32 Var33 Var34 Var35 Var36 Var37 Var38 Var39 Var40 Var41 Var42 Var43 Var44 Var45 Var46 Var47 Var48 Var49 Var50 Var51 Var52 Var53 Var54 Var55 Var56 Var57 Var58 Var59 Var60 Var61 Var62 Var63 Var64 Var65 Var66 Var67 Var68 Var69 Var70 Var71 Var72 Var73 Var74 Var75 Var76 Var77 Var78 Var79 Var80 Var81 Var82 Var83 Var84 Var85 Var86 Var87 Var88 Var89 Var90 Var91 Var92 Var93 Var94 Var95 Var96 Var97 Var98 Var99 Var100 Var101 ____ ________ _______ ________ _______ _______ ________ _________ _________ ________ ________ ________ _______ _______ ________ _________ _______ ________ ________ ________ ________ ________ ________ ________ ________ ________ ________ _______ ________ _________ ________ _______ _________ _______ ________ ________ _______ _______ ________ ________ ________ _______ ________ ________ ________ ________ ________ ________ ________ _________ ________ ________ ________ ________ ________ ________ ________ __________ ________ ________ _______ _________ ________ ________ _______ ________ ________ ________ ________ ________ _________ ________ ________ ________ _________ ________ _______ _______ ________ ________ ________ ________ ________ ________ ________ _______ _________ ________ _______ ________ ________ ________ ________ ________ ________ ________ ________ ________ ________ _______ ________ 1 0.60934 0.41228 0.96138 0.75335 0.73362 0.57893 0.62001 0.48239 0.72311 0.22914 0.17226 0.71013 0.19308 0.045383 0.024204 0.91746 0.16091 0.85058 0.66303 0.41432 0.45231 0.73755 0.24872 0.54787 0.48318 0.06868 0.80486 0.25839 0.3732 0.60482 0.53316 0.47668 0.1897 0.23484 0.92454 0.39019 0.89678 0.20534 0.77467 0.59819 0.41233 0.58627 0.20233 0.80567 0.74248 0.72241 0.9074 0.65871 0.078089 0.47845 0.44386 0.95385 0.14284 0.79612 0.77617 0.71008 0.11956 0.95656 0.59593 0.25906 0.67243 0.39088 0.50959 0.57152 0.88522 0.49052 0.81382 0.98422 0.39338 0.11861 0.84217 0.30782 0.61139 0.59508 0.31297 0.14264 0.06999 0.29594 0.9306 0.038095 0.37504 0.30042 0.075832 0.76739 0.11339 0.95124 0.80809 0.65645 0.3883 0.71825 0.72802 0.15722 0.37671 0.59552 0.48134 0.89051 0.15932 0.28034 0.76815 0.079588 2 0.74607 0.9261 0.18984 0.28609 0.34641 0.9437 0.36801 0.30395 0.41699 0.35765 0.66646 0.62166 0.66872 0.10366 0.46985 0.74996 0.37935 0.22141 0.32305 0.45677 0.2138 0.84576 0.44468 0.59711 0.013027 0.68416 0.48287 0.77899 0.61276 0.66745 0.83339 0.49343 0.14961 0.16365 0.63579 0.96225 0.1534 0.40913 0.90849 0.73268 0.44142 0.1929 0.28588 0.07284 0.80979 0.52165 0.82256 0.23621 0.4108 0.72204 0.01853 0.22702 0.59341 0.015625 0.096132 0.94096 0.47366 0.91901 0.34049 0.43665 0.6506 0.61571 0.29028 0.30565 0.94356 0.52737 0.39726 0.8459 0.52955 0.54245 0.66741 0.1621 0.79337 0.4125 0.95962 0.51608 0.10316 0.97265 0.3304 0.926 0.98357 0.32305 0.15125 0.0424 0.64585 0.90045 0.31051 0.39294 0.16711 0.69302 0.93312 0.17128 0.88058 0.87729 0.64972 0.70213 0.99944 0.21894 0.92952 0.38456 3 0.056507 0.60993 0.43087 0.49022 0.71789 0.1267 0.58298 0.12954 0.17174 0.24019 0.11973 0.60025 0.36287 0.8398 0.72146 0.46938 0.058702 0.88124 0.10354 0.17898 0.048325 0.58728 0.23646 0.93082 0.7258 0.13353 0.26043 0.084074 0.088172 0.34569 0.53471 0.24513 0.15941 0.46582 0.14535 0.22837 0.77705 0.38835 0.67378 0.54708 0.71109 0.81244 0.53085 0.53917 0.47232 0.094309 0.44911 0.9024 0.21649 0.8101 0.91265 0.86201 0.26474 0.08131 0.084127 0.87782 0.059883 0.33955 0.44366 0.68997 0.0097025 0.067427 0.59195 0.752 0.55239 0.60749 0.034958 0.13131 0.82545 0.038944 0.27959 0.51621 0.33117 0.0087427 0.16321 0.49383 0.18322 0.25884 0.17575 0.57107 0.062416 0.98622 0.94569 0.1957 0.35438 0.62334 0.91792 0.84047 0.83941 0.57211 0.90979 0.71167 0.95633 0.46891 0.97152 0.027424 0.19706 0.90119 0.67509 0.79317 4 0.93966 0.2272 0.88774 0.82489 0.29529 0.31949 0.29463 0.78308 0.29117 0.88345 0.83304 0.30803 0.26609 0.13072 0.65953 0.38895 0.74296 0.36745 0.89567 0.074229 0.21721 0.13088 0.87791 0.76789 0.711 0.114 0.43777 0.21054 0.97305 0.5604 0.76661 0.25144 0.12498 0.32807 0.73068 0.36622 0.79672 0.90371 0.55191 0.72107 0.4041 0.44332 0.7859 0.25946 0.80694 0.55883 0.81411 0.7914 0.044146 0.60343 0.16701 0.096246 0.33543 0.41466 0.048513 0.033821 0.75121 0.94654 0.57807 0.96392 0.85833 0.98076 0.10382 0.69959 0.71307 0.1177 0.25553 0.51073 0.37228 0.97716 0.45396 0.11057 0.83202 0.61741 0.034436 0.36974 0.26339 0.21656 0.47173 0.02078 0.93092 0.37064 0.32941 0.38112 0.66637 0.022551 0.98704 0.57414 0.53323 0.36728 0.72583 0.047636 0.49896 0.28819 0.22884 0.18768 0.062169 0.87022 0.97436 0.6738 5 0.49765 0.1902 0.33006 0.97245 0.57708 0.048607 0.21217 0.017764 0.69655 0.78888 0.29793 0.72432 0.4441 0.44731 0.064956 0.71054 0.15738 0.091103 0.75787 0.92746 0.74261 0.24166 0.85907 0.094186 0.48468 0.32661 0.89782 0.70075 0.68668 0.43568 0.96741 0.70644 0.95628 0.13245 0.27961 0.27098 0.14163 0.13169 0.72964 0.36508 0.74474 0.38643 0.23282 0.37245 0.60368 0.70614 0.82396 0.20904 0.9492 0.40152 0.86896 0.4376 0.32692 0.1792 0.49874 0.36003 0.33506 0.062076 0.93349 0.21804 0.0027247 0.71302 0.57431 0.76925 0.26162 0.86494 0.41549 0.58036 0.90037 0.0091749 0.1948 0.47021 0.086224 0.79844 0.51927 0.80605 0.54678 0.90374 0.587 0.31774 0.89702 0.32547 0.99782 0.95684 0.54806 0.42164 0.15962 0.25327 0.38367 0.14185 0.81834 0.42316 0.51804 0.4311 0.042471 0.81202 0.45314 0.80903 0.36831 0.578 6 0.76119 0.74544 0.70575 0.96658 0.99125 0.2056 0.1684 0.48392 0.97375 0.1804 0.65294 0.34244 0.10543 0.41721 0.42623 0.8696 0.35074 0.586 0.5457 0.97746 0.71565 0.66595 0.91561 0.87149 0.9697 0.81043 0.15148 0.62701 0.3962 0.076514 0.48425 0.0040145 0.69675 0.5877 0.70389 0.70743 0.69004 0.033235 0.80519 0.086283 0.90269 0.028325 0.48053 0.80191 0.26284 0.68226 0.58547 0.90191 0.28487 0.83018 0.11888 0.92675 0.1637 0.057282 0.24832 0.60035 0.51298 0.4169 0.37536 0.53459 0.12339 0.32339 0.42601 0.26082 0.98365 0.58909 0.31824 0.59056 0.26634 0.20877 0.63419 0.47419 0.2885 0.2343 0.96496 0.72009 0.63673 0.79353 0.71175 0.97569 0.53734 0.078298 0.48654 0.060153 0.77269 0.97683 0.24416 0.61069 0.6926 0.052411 0.80974 0.94054 0.29507 0.87953 0.2172 0.49458 0.84199 0.47628 0.33498 0.90374 7 0.48042 0.49629 0.53131 0.13153 0.76732 0.25721 0.28139 0.85896 0.34541 0.73485 0.62909 0.99731 0.34831 0.3676 0.9833 0.46372 0.56888 0.87243 0.25773 0.9309 0.1894 0.61857 0.69223 0.61518 0.23497 0.886 0.38249 0.30117 0.17568 0.24151 0.6057 0.45637 0.85376 0.585 0.083716 0.1928 0.33882 0.22927 0.03123 0.83925 0.61997 0.94545 0.61984 0.94748 0.46634 0.85715 0.055111 0.41073 0.0082405 0.075607 0.60588 0.29163 0.61809 0.44138 0.69851 0.26379 0.0038506 0.85805 0.63654 0.68159 0.76881 0.11629 0.34936 0.61024 0.034629 0.16909 0.34867 0.034714 0.8996 0.41425 0.39539 0.20449 0.59932 0.45219 0.72288 0.19662 0.84593 0.66756 0.41915 0.040928 0.62359 0.029508 0.8705 0.93878 0.86548 0.89026 0.94639 0.17799 0.65342 0.39663 0.29842 0.05143 0.55265 0.91111 0.71972 0.44783 0.42892 0.076663 0.64333 0.17993 8 0.86208 0.35009 0.081241 0.81582 0.42451 0.4436 0.94143 0.31362 0.041757 0.51746 0.15201 0.4171 0.22454 0.46769 0.0096036 0.82312 0.076112 0.48318 0.064051 0.38794 0.7019 0.74648 0.96623 0.66759 0.99051 0.25272 0.14338 0.68576 0.24395 0.13655 0.79306 0.004621 0.66809 0.35033 0.039661 0.20504 0.31579 0.34859 0.68287 0.87407 0.24193 0.71493 0.56838 0.70919 0.76655 0.50376 0.17685 0.1997 0.36245 0.99837 0.078885 0.53659 0.76478 0.91923 0.53795 0.89402 0.9593 0.0777 0.19195 0.96927 0.14445 0.88398 0.044561 0.91297 0.10999 0.59722 0.39004 0.19731 0.6176 0.54399 0.8038 0.71193 0.32986 0.14499 0.73628 0.61161 0.21026 0.98468 0.36466 0.38124 0.13479 0.5335 0.50932 0.40601 0.13579 0.076734 0.073911 0.16306 0.094127 0.68276 0.056519 0.097809 0.94226 0.73928 0.16872 0.64081 0.40827 0.6774 0.93087 0.56652 9 0.15025 0.49766 0.18278 0.33262 0.19792 0.1186 0.10626 0.33549 0.79803 0.36891 0.29357 0.59714 0.83553 0.68154 0.11905 0.6023 0.076052 0.54372 0.78298 0.43716 0.45274 0.46909 0.032424 0.94333 0.55463 0.98789 0.83547 0.97961 0.125 0.40526 0.26124 0.19537 0.47562 0.72504 0.55566 0.85005 0.8484 0.74189 0.17527 0.26053 0.455 0.51701 0.22418 0.6503 0.93617 0.01136 0.054298 0.66986 0.44161 0.44197 0.36087 0.036945 0.1571 0.075762 0.35572 0.012746 0.98931 0.898 0.10566 0.4645 0.30299 0.68164 0.43249 0.92623 0.89522 0.47155 0.070348 0.12726 0.055652 0.34697 0.47332 0.44064 0.13159 0.25585 0.36563 0.21545 0.48243 0.6965 0.30526 0.34165 0.02936 0.75028 0.20553 0.78114 0.78845 0.11807 0.0582 0.19467 0.67864 0.69229 0.80314 0.29267 0.61119 0.052362 0.80459 0.93727 0.46557 0.83864 0.31009 0.6666 10 0.38272 0.49054 0.88093 0.24007 0.61967 0.74653 0.48185 0.4766 0.67333 0.81335 0.098907 0.46191 0.94039 0.38427 0.71957 0.76121 0.11172 0.46633 0.50905 0.31121 0.73781 0.93037 0.81972 0.91799 0.76039 0.28177 0.53094 0.64562 0.84524 0.016492 0.40047 0.87437 0.55318 0.58477 0.40839 0.52439 0.9814 0.80284 0.72141 0.96421 0.23132 0.37984 0.52824 0.72419 0.20072 0.87644 0.31964 0.96023 0.25921 0.78739 0.81876 0.7963 0.93388 0.76847 0.8172 0.47914 0.86418 0.43248 0.27891 0.58355 0.01191 0.58872 0.046864 0.98333 0.84966 0.45902 0.90711 0.09325 0.94481 0.8273 0.79342 0.9828 0.82354 0.061158 0.67865 0.12898 0.58025 0.32933 0.62075 0.66334 0.59196 0.90948 0.31871 0.1884 0.41296 0.61508 0.8039 0.9364 0.1316 0.28932 0.65825 0.57695 0.90695 0.24469 0.22722 0.24209 0.25853 0.20639 0.38315 0.42765 11 0.78603 0.6472 0.54936 0.49619 0.08472 0.059674 0.44305 0.13438 0.91709 0.24273 0.71252 0.15065 0.19339 0.58526 0.16396 0.82985 0.08942 0.11171 0.59184 0.067172 0.85046 0.89484 0.43159 0.15591 0.44177 0.086777 0.13027 0.18516 0.03424 0.64699 0.10243 0.35388 0.64327 0.40341 0.28404 0.78143 0.54792 0.5289 0.091321 0.34207 0.33859 0.37682 0.26768 0.083107 0.027492 0.75949 0.29267 0.57241 0.62875 0.38928 0.33844 0.7653 0.070767 0.6154 0.6727 0.08711 0.59511 0.61194 0.35463 0.82691 0.65987 0.14166 0.59464 0.71219 0.10589 0.068851 0.73786 0.18019 0.3215 0.54699 0.51567 0.41017 0.76911 0.64212 0.53179 0.52647 0.83006 0.066539 0.14889 0.92747 0.059095 0.72586 0.85201 0.16228 0.60958 0.96288 0.73117 0.83837 0.20311 0.94816 0.3211 0.30385 0.32802 0.78189 0.27281 0.46633 0.50502 0.92008 0.75039 0.063053 12 0.10409 0.35745 0.13205 0.64028 0.97499 0.36933 0.8374 0.020462 0.71071 0.069018 0.35889 0.97622 0.96562 0.77174 0.90539 0.98225 0.43336 0.47993 0.70537 0.75943 0.1653 0.14721 0.14913 0.75667 0.53203 0.79435 0.11266 0.68594 0.47694 0.32028 0.51642 0.61725 0.48291 0.6107 0.90498 0.30149 0.70701 0.02703 0.76749 0.27247 0.64088 0.9782 0.79364 0.53429 0.68652 0.5634 0.10474 0.7976 0.42391 0.33775 0.25014 0.91654 0.71179 0.27363 0.9335 0.22424 0.29397 0.81862 0.64284 0.14657 0.26683 0.74167 0.77023 0.73997 0.051426 0.9914 0.038939 0.98545 0.33827 0.89527 0.28687 0.80931 0.61096 0.90069 0.10202 0.46659 0.45988 0.26431 0.88321 0.55918 0.83421 0.44288 0.37739 0.99158 0.58676 0.16412 0.34048 0.72263 0.99034 0.35206 0.26576 0.10437 0.098489 0.7389 0.80889 0.38193 0.45555 0.9327 0.39891 0.39356 13 0.77646 0.40928 0.5054 0.60477 0.14686 0.75461 0.18291 0.0057126 0.82214 0.33281 0.16122 0.76548 0.81537 0.30246 0.66608 0.54209 0.77393 0.80043 0.78653 0.67346 0.49271 0.97815 0.097988 0.052667 0.76724 0.93456 0.49472 0.013755 0.63789 0.87705 0.93962 0.58203 0.71044 0.074047 0.89819 0.6841 0.93426 0.51439 0.24525 0.48253 0.94023 0.24255 0.95977 0.91133 0.25085 0.83874 0.82167 0.013732 0.31709 0.049603 0.3961 0.44127 0.87938 0.57593 0.31907 0.5962 0.00042626 0.7092 0.53176 0.15703 0.12269 0.82727 0.83685 0.7024 0.78749 0.604 0.94013 0.59013 0.68751 0.60857 0.096008 0.014953 0.931 0.12 0.8801 0.89325 0.87775 0.67772 0.34817 0.44378 0.29703 0.9501 0.38179 0.83489 0.46223 0.82619 0.11207 0.52264 0.021148 0.67436 0.064509 0.76441 0.18948 0.93338 0.667 0.33498 0.21646 0.56064 0.98466 0.025562 14 0.99175 0.36803 0.68187 0.8202 0.18895 0.036409 0.0095861 0.43152 0.57797 0.54541 0.14165 0.6172 0.5924 0.96422 0.13877 0.2237 0.82585 0.22066 0.98341 0.68902 0.50951 0.6857 0.6207 0.67534 0.44458 0.33036 0.88484 0.36827 0.22769 0.90531 0.36726 0.26976 0.08768 0.33453 0.57601 0.03502 0.11813 0.18778 0.078757 0.96197 0.64708 0.8849 0.62932 0.19292 0.88623 0.69708 0.39903 0.15601 0.40491 0.1408 0.61146 0.40925 0.76106 0.74674 0.074171 0.74641 0.68145 0.78353 0.085941 0.88268 0.55889 0.81884 0.72882 0.73661 0.89245 0.14914 0.39229 0.33056 0.66393 0.80538 0.96335 0.21173 0.16002 0.13002 0.59836 0.65274 0.48723 0.1906 0.059987 0.48984 0.36059 0.41472 0.48634 0.16803 0.9704 0.0090322 0.87867 0.93171 0.90876 0.76978 0.25653 0.61592 0.3106 0.16863 0.30546 0.86005 0.24715 0.55683 0.66349 0.8908 15 0.17909 0.32293 0.456 0.637 0.80468 0.89721 0.080505 0.070161 0.34259 0.27458 0.15137 0.60404 0.21965 0.4413 0.7322 0.1046 0.19484 0.68632 0.41881 0.15758 0.70859 0.5795 0.39878 0.65357 0.56837 0.89524 0.3527 0.39451 0.33866 0.41751 0.36596 0.035558 0.16049 0.93916 0.91315 0.89067 0.22712 0.54226 0.81857 0.22426 0.76492 0.4492 0.044863 0.86987 0.82956 0.23879 0.17161 0.61053 0.42819 0.51293 0.14963 0.84103 0.51757 0.51149 0.58192 0.36974 0.61854 0.34553 0.77424 0.4075 0.31509 0.39839 0.78085 0.64463 0.62444 0.53956 0.045159 0.27445 0.23364 0.50398 0.97451 0.46307 0.39999 0.42219 0.077163 0.1872 0.2559 0.55743 0.96627 0.67017 0.11215 0.61302 0.22307 0.033624 0.7392 0.79219 0.56843 0.87393 0.71306 0.67819 0.11419 0.15179 0.12508 0.68145 0.25502 0.69142 0.016755 0.39109 0.66067 0.5445 16 0.51964 0.6694 0.59271 0.44195 0.23298 0.83903 0.69801 0.3117 0.87863 0.51199 0.24594 0.26265 0.96326 0.22311 0.74875 0.26366 0.85324 0.3042 0.68953 0.015327 0.96371 0.058244 0.74332 0.29944 0.18723 0.18192 0.93701 0.1881 0.0031077 0.49636 0.4747 0.3027 0.57047 0.54116 0.73985 0.71164 0.75239 0.62562 0.097277 0.073689 0.55172 0.85387 0.30945 0.035297 0.13077 0.070332 0.70545 0.11547 0.55115 0.70877 0.69176 0.047917 0.42665 0.51935 0.04183 0.44038 0.58944 0.27499 0.4526 0.48551 0.85055 0.79334 0.82556 0.75974 0.41717 0.1058 0.59793 0.88216 0.32676 0.30166 0.57922 0.64712 0.59858 0.94735 0.35479 0.60535 0.68156 0.49511 0.030522 0.5711 0.32785 0.52491 0.17005 0.94008 0.71279 0.077134 0.051339 0.40462 0.87822 0.48052 0.17212 0.80602 0.91066 0.27821 0.87465 0.94104 0.38919 0.52581 0.52215 0.87516
I Hope this helps you with your issues.
  1 Comment
Walter Roberson
Walter Roberson on 17 Oct 2023
I read the question quite differently. It looks to me as if the question is about how to read out 100 different device sensors each second.
I further suspect that this is a situation with wireless sensors and needing to relay data between nodes, such as forming clusters with the cluster heads gathering information from the other devices within the cluster and the cluster heads send the accumulated data to host. But I do not know if it is a situation with the sensors moving.

Sign in to comment.

More Answers (0)

Categories

Find more on Tables in Help Center and File Exchange

Products


Release

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!