久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<i id='iYTJh'><tr id='iYTJh'><dt id='iYTJh'><q id='iYTJh'><span id='iYTJh'><b id='iYTJh'><form id='iYTJh'><ins id='iYTJh'></ins><ul id='iYTJh'></ul><sub id='iYTJh'></sub></form><legend id='iYTJh'></legend><bdo id='iYTJh'><pre id='iYTJh'><center id='iYTJh'></center></pre></bdo></b><th id='iYTJh'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='iYTJh'><tfoot id='iYTJh'></tfoot><dl id='iYTJh'><fieldset id='iYTJh'></fieldset></dl></div>
    <bdo id='iYTJh'></bdo><ul id='iYTJh'></ul>
  • <legend id='iYTJh'><style id='iYTJh'><dir id='iYTJh'><q id='iYTJh'></q></dir></style></legend>
  • <small id='iYTJh'></small><noframes id='iYTJh'>

  • <tfoot id='iYTJh'></tfoot>

        Sum 多維數組 C#

        Sum multidimensional array C#(Sum 多維數組 C#)
          <tbody id='3KUAj'></tbody>
        • <i id='3KUAj'><tr id='3KUAj'><dt id='3KUAj'><q id='3KUAj'><span id='3KUAj'><b id='3KUAj'><form id='3KUAj'><ins id='3KUAj'></ins><ul id='3KUAj'></ul><sub id='3KUAj'></sub></form><legend id='3KUAj'></legend><bdo id='3KUAj'><pre id='3KUAj'><center id='3KUAj'></center></pre></bdo></b><th id='3KUAj'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='3KUAj'><tfoot id='3KUAj'></tfoot><dl id='3KUAj'><fieldset id='3KUAj'></fieldset></dl></div>
            <bdo id='3KUAj'></bdo><ul id='3KUAj'></ul>

              1. <legend id='3KUAj'><style id='3KUAj'><dir id='3KUAj'><q id='3KUAj'></q></dir></style></legend>

                <small id='3KUAj'></small><noframes id='3KUAj'>

                • <tfoot id='3KUAj'></tfoot>
                  本文介紹了Sum 多維數組 C#的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  如何從多維數組中取出一些值,然后計算平均選擇值?

                  How do I sort out some values from multidimensional Array and then calculate the average selected value?

                  所以當我點擊某個圖像時,它不僅應該在鼠標指針所在的點顯示深度數據(來自 Microsoft Kinect),而且還應該計算環境中的值(即多維數組).

                  So when I click some Image, it should show depth data (from Microsoft Kinect) not only in the point where the mouse pointer stands, but also it should calculate the value in the environment (which is multidimensional Array).

                  這是我的代碼:

                      protected void imageIR_MouseClick(object sender, System.Windows.Input.MouseEventArgs e)
                      {
                          // Get the x and y coordinates of the mouse pointer.
                          System.Windows.Point mousePoint = e.GetPosition(imageIR);
                          double xpos_IR = mousePoint.X;
                          double ypos_IR = mousePoint.Y;
                          int x = (int)xpos_IR;
                          int y = (int)ypos_IR;
                          lbCoord.Content = "x- & y- Koordinate [pixel]: " + x + " ; " + y;
                          int d = (ushort)pixelData[x + y * this.depthFrame.Width];
                          d = d >> 3;
                          int xpos_Content = (int)((x - 320) * 0.03501 / 2 * d/10);
                          int ypos_Content = (int)((240 - y) * 0.03501 / 2 * d/10);
                          xpos.Content = "x- Koordinate [mm]: " + xpos_Content;
                          ypos.Content = "y- Koordinate [mm]: " + ypos_Content;
                          zpos.Content = "z- Koordinate [mm]: " + (d);
                  
                          // Allocating array size
                          int i = 10;
                          int[] x_array = new int[i];
                          int[] y_array = new int[i];
                          int[,] d_array = new int[i,i];
                  
                          for (int m = 0; m < 10; m++)
                          {
                              for (int n = 0; n < 10; n++)
                              {
                                  x_array[m] = x + m;
                                  y_array[n] = y + n;
                                  d_array[m, n] = (ushort)pixelData[x_array[m] + y_array[n] * this.depthFrame.Width];
                                  d_array[m, n] = d_array[m, n] >> 3;
                              }
                          }
                      }
                  

                  那么,首先:如何對 d_array[m,n] 中的所有值求和?是否可以計算每一行的總和(->一維數組/向量),然后再次計算列的總和(->零維數組/標量)?

                  So, firstly: how do I sum all the values from d_array[m,n] ? Is it possible to calculate the sum of each row (-> one dimensional Array / vector) and then calculate again the sum of the column (-> zero-dimensional Array / scalar)?

                  推薦答案

                  所以,首先:如何對 d_array[m,n] 中的所有值求和

                  So, firstly: how do I sum all the values from d_array[m,n]

                  你可以使用:

                  int sum = d_array.Cast<int>().Sum();
                  

                  這將自動展平多維數組并取所有元素的總和.

                  This will automatically flatten out the multidimensional array and take the sum of all elements.

                  是否可以先計算每一行的總和(->一維數組/向量),然后再計算列的總和(->零維數組/標量)?

                  Is it possible to calculate the sum of each row (-> one dimensional Array / vector) and then calculate again the sum of the column (-> zero-dimensional Array / scalar)?

                  是的,但這需要手動循環.沒有一個簡單的方法可以解決這個問題,盡管編寫方法來處理它很容易,即:

                  Yes, but this would require looping manually. There is no simple one liner for this, though it would be easy to write methods to handle it, ie:

                  IEnumerable<T> GetRow(T[,] array, int row)
                  {
                      for (int i = 0; i <= array.GetUpperBound(1); ++i)
                           yield return array[row, i];
                  }
                  
                  IEnumerable<T> GetColumn(T[,] array, int column)
                  {
                      for (int i = 0; i <= array.GetUpperBound(0); ++i)
                           yield return array[i, column];
                  }
                  

                  你可以這樣做:

                  var row1Sum = GetRow(d_array, 1).Sum();
                  

                  這篇關于Sum 多維數組 C#的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  What are good algorithms for vehicle license plate detection?(車牌檢測有哪些好的算法?)
                  onClick event for Image in Unity(Unity中圖像的onClick事件)
                  Running Total C#(運行總 C#)
                  Deleting a directory when clicked on a hyperlink with JAvascript.ASP.NET C#(單擊帶有 JAvascript.ASP.NET C# 的超鏈接時刪除目錄)
                  asp.net listview highlight row on click(asp.net listview 在單擊時突出顯示行)
                  Calling A Button OnClick from a function(從函數調用按鈕 OnClick)
                  <tfoot id='xmY74'></tfoot>

                      <tbody id='xmY74'></tbody>
                    <legend id='xmY74'><style id='xmY74'><dir id='xmY74'><q id='xmY74'></q></dir></style></legend>
                    • <i id='xmY74'><tr id='xmY74'><dt id='xmY74'><q id='xmY74'><span id='xmY74'><b id='xmY74'><form id='xmY74'><ins id='xmY74'></ins><ul id='xmY74'></ul><sub id='xmY74'></sub></form><legend id='xmY74'></legend><bdo id='xmY74'><pre id='xmY74'><center id='xmY74'></center></pre></bdo></b><th id='xmY74'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='xmY74'><tfoot id='xmY74'></tfoot><dl id='xmY74'><fieldset id='xmY74'></fieldset></dl></div>

                    • <small id='xmY74'></small><noframes id='xmY74'>

                        <bdo id='xmY74'></bdo><ul id='xmY74'></ul>

                            主站蜘蛛池模板: 日韩一区二区三区视频 | 欧美精品一区二区三区蜜桃视频 | 日韩精品无码一区二区三区 | 久久久久久久一区 | 国产高清在线视频 | 国产亚韩| 18gay男同69亚洲网站 | 日韩欧美亚洲 | 成人一区二区在线 | 久久精品在线播放 | 日韩在线免费 | 亚洲精品99 | 国产精品视频网站 | 成人欧美一区二区 | 日韩高清一区二区 | 久久成人在线视频 | 成人国产一区二区三区精品麻豆 | 国产成人自拍一区 | 宅男伊人 | 综合久久综合久久 | 国产伦精品一区二区三区四区视频 | 你懂的国产 | 午夜久久久 | 亚洲精品影院 | 久久影音先锋 | 无码一区二区三区视频 | 综合在线视频 | 91在线视频免费观看 | 亚洲精品91 | 亚洲国产成人av好男人在线观看 | 亚洲综合视频 | 天天干天天玩天天操 | 欧美精品中文 | 国产免费一级一级 | 日韩国产欧美 | 插插宗合网 | 色综合色综合 | 国产资源在线播放 | 午夜视频一区二区三区 | 国产一区二区三区 | 久久99精品久久久久久琪琪 |