How to create table with 2D function values?Calling Table with custom iteratorHow to create a Table of Tables with indexed variablesInstruct a Table to only evaluate until a condition is fulfilledCreate a table with inline conditionsHow could I make an Excel-like table?Exclude Infinite Value in Tableremove unevaluated cells from tableCreate a table indexed form a list giving a the index specificationsTable with conditionsCumulative total of columns in a matrix or table

Junos[MX]: How to show VPLS instance associated with given subinterface

What is the English pronunciation of "pain au chocolat"?

Does the UK parliament need to pass secondary legislation to accept the Article 50 extension

Add big quotation marks inside my colorbox

Mimic lecturing on blackboard, facing audience

Pre-mixing cryogenic fuels and using only one fuel tank

Make a Bowl of Alphabet Soup

Why is short-wave infrared portion of electromagnetic spectrum so sensitive to fire?

Has any country ever had 2 former presidents in jail simultaneously?

Bridge building with irregular planks

What is Cash Advance APR?

How can I write humor as character trait?

How to create table with 2D function values?

It grows, but water kills it

Does an advisor owe his/her student anything? Will an advisor keep a PhD student only out of pity?

What are the balance implications behind making invisible things auto-hide?

Can disgust be a key component of horror?

X marks the what?

Does the Catholic Church consider Constantine's vision of "by this symbol conquer" to be from God?

Example of factorization in a polynomial ring which is not an UFD

Do the primes contain an infinite almost arithmetic progression?

Can a college of swords bard use blade flourish on an OA from dissonant whispers?

How can I avoid dust and bubbles when installing window film?

How to get directions in deep space?



How to create table with 2D function values?


Calling Table with custom iteratorHow to create a Table of Tables with indexed variablesInstruct a Table to only evaluate until a condition is fulfilledCreate a table with inline conditionsHow could I make an Excel-like table?Exclude Infinite Value in Tableremove unevaluated cells from tableCreate a table indexed form a list giving a the index specificationsTable with conditionsCumulative total of columns in a matrix or table













2












$begingroup$


Consider some function f[x,y]. I want to create a table in the form



table = x1,y1,f[x1,y1],x1,y2,f[x1,y2],...,x2,y1,f[x2,y1],x2,y2,f[x2,y2],...,


where $x_i,x_i+1$ and $y_i,y_i+1$ are separated by some distances $Delta x$, $Delta y$, and i ranges from 1 to some N.



The only way I know is to manually create a table



table=Join[Table[x1,y,f[x1,y],y,y1,yN,Deltay],Table[x2,y,f[x2,y],y,y1,yN,Deltay],...] 


However, this is not a smart way, especially for large N. Could you please provide some smarter way to build the table?










share|improve this question









$endgroup$







  • 1




    $begingroup$
    Have a look at Menu/Help/WolframDocumentation/Table. That's what will help you.
    $endgroup$
    – Alexei Boulbitch
    4 hours ago















2












$begingroup$


Consider some function f[x,y]. I want to create a table in the form



table = x1,y1,f[x1,y1],x1,y2,f[x1,y2],...,x2,y1,f[x2,y1],x2,y2,f[x2,y2],...,


where $x_i,x_i+1$ and $y_i,y_i+1$ are separated by some distances $Delta x$, $Delta y$, and i ranges from 1 to some N.



The only way I know is to manually create a table



table=Join[Table[x1,y,f[x1,y],y,y1,yN,Deltay],Table[x2,y,f[x2,y],y,y1,yN,Deltay],...] 


However, this is not a smart way, especially for large N. Could you please provide some smarter way to build the table?










share|improve this question









$endgroup$







  • 1




    $begingroup$
    Have a look at Menu/Help/WolframDocumentation/Table. That's what will help you.
    $endgroup$
    – Alexei Boulbitch
    4 hours ago













2












2








2





$begingroup$


Consider some function f[x,y]. I want to create a table in the form



table = x1,y1,f[x1,y1],x1,y2,f[x1,y2],...,x2,y1,f[x2,y1],x2,y2,f[x2,y2],...,


where $x_i,x_i+1$ and $y_i,y_i+1$ are separated by some distances $Delta x$, $Delta y$, and i ranges from 1 to some N.



The only way I know is to manually create a table



table=Join[Table[x1,y,f[x1,y],y,y1,yN,Deltay],Table[x2,y,f[x2,y],y,y1,yN,Deltay],...] 


However, this is not a smart way, especially for large N. Could you please provide some smarter way to build the table?










share|improve this question









$endgroup$




Consider some function f[x,y]. I want to create a table in the form



table = x1,y1,f[x1,y1],x1,y2,f[x1,y2],...,x2,y1,f[x2,y1],x2,y2,f[x2,y2],...,


where $x_i,x_i+1$ and $y_i,y_i+1$ are separated by some distances $Delta x$, $Delta y$, and i ranges from 1 to some N.



The only way I know is to manually create a table



table=Join[Table[x1,y,f[x1,y],y,y1,yN,Deltay],Table[x2,y,f[x2,y],y,y1,yN,Deltay],...] 


However, this is not a smart way, especially for large N. Could you please provide some smarter way to build the table?







table






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 4 hours ago









John TaylorJohn Taylor

761211




761211







  • 1




    $begingroup$
    Have a look at Menu/Help/WolframDocumentation/Table. That's what will help you.
    $endgroup$
    – Alexei Boulbitch
    4 hours ago












  • 1




    $begingroup$
    Have a look at Menu/Help/WolframDocumentation/Table. That's what will help you.
    $endgroup$
    – Alexei Boulbitch
    4 hours ago







1




1




$begingroup$
Have a look at Menu/Help/WolframDocumentation/Table. That's what will help you.
$endgroup$
– Alexei Boulbitch
4 hours ago




$begingroup$
Have a look at Menu/Help/WolframDocumentation/Table. That's what will help you.
$endgroup$
– Alexei Boulbitch
4 hours ago










2 Answers
2






active

oldest

votes


















5












$begingroup$

x1 = 1; xN = 9; Δx = 3;
y1 = 0; yN = 5; Δy = 1;

table = Join @@ Table[i, j, f[i, j], i, x1, xN, Δx, j, y1, yN, Δy]



1, 0, f[1, 0], 1, 1, f[1, 1], 1, 2, f[1, 2], 1, 3,
f[1, 3], 1, 4, f[1, 4], 1, 5, f[1, 5],

4, 0, f[4, 0], 4, 1,
f[4, 1], 4, 2, f[4, 2], 4, 3, f[4, 3], 4, 4, f[4, 4], 4, 5,
f[4, 5],

7, 0, f[7, 0], 7, 1, f[7, 1], 7, 2, f[7, 2], 7, 3,
f[7, 3], 7, 4, f[7, 4], 7, 5, f[7, 5]




Also



table2 = ##, f @ ## & @@@ Tuples[Range[x1, xN, Δx], Range[y1, yN, Δy]]
table2 == table



True







share|improve this answer











$endgroup$




















    0












    $begingroup$

    This would be a nice answer (using the Outer product to create the 2D array):



    x1 = 1; xN = 9; dx = 3;
    y1 = 0; yN = 5; dy = 1;
    Partition[Flatten[
    Outer[Through[List, f[#1, #2]] &, Range[x1, xN, dx], Range[y1, yN, dy]]], 3]


    except that Outer returns too many levels -- hence the Flatten and Partition are needed to remove the extra brackets. Answer is the same as kglr's.






    share|improve this answer









    $endgroup$












      Your Answer





      StackExchange.ifUsing("editor", function ()
      return StackExchange.using("mathjaxEditing", function ()
      StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
      StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
      );
      );
      , "mathjax-editing");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "387"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f193773%2fhow-to-create-table-with-2d-function-values%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      5












      $begingroup$

      x1 = 1; xN = 9; Δx = 3;
      y1 = 0; yN = 5; Δy = 1;

      table = Join @@ Table[i, j, f[i, j], i, x1, xN, Δx, j, y1, yN, Δy]



      1, 0, f[1, 0], 1, 1, f[1, 1], 1, 2, f[1, 2], 1, 3,
      f[1, 3], 1, 4, f[1, 4], 1, 5, f[1, 5],

      4, 0, f[4, 0], 4, 1,
      f[4, 1], 4, 2, f[4, 2], 4, 3, f[4, 3], 4, 4, f[4, 4], 4, 5,
      f[4, 5],

      7, 0, f[7, 0], 7, 1, f[7, 1], 7, 2, f[7, 2], 7, 3,
      f[7, 3], 7, 4, f[7, 4], 7, 5, f[7, 5]




      Also



      table2 = ##, f @ ## & @@@ Tuples[Range[x1, xN, Δx], Range[y1, yN, Δy]]
      table2 == table



      True







      share|improve this answer











      $endgroup$

















        5












        $begingroup$

        x1 = 1; xN = 9; Δx = 3;
        y1 = 0; yN = 5; Δy = 1;

        table = Join @@ Table[i, j, f[i, j], i, x1, xN, Δx, j, y1, yN, Δy]



        1, 0, f[1, 0], 1, 1, f[1, 1], 1, 2, f[1, 2], 1, 3,
        f[1, 3], 1, 4, f[1, 4], 1, 5, f[1, 5],

        4, 0, f[4, 0], 4, 1,
        f[4, 1], 4, 2, f[4, 2], 4, 3, f[4, 3], 4, 4, f[4, 4], 4, 5,
        f[4, 5],

        7, 0, f[7, 0], 7, 1, f[7, 1], 7, 2, f[7, 2], 7, 3,
        f[7, 3], 7, 4, f[7, 4], 7, 5, f[7, 5]




        Also



        table2 = ##, f @ ## & @@@ Tuples[Range[x1, xN, Δx], Range[y1, yN, Δy]]
        table2 == table



        True







        share|improve this answer











        $endgroup$















          5












          5








          5





          $begingroup$

          x1 = 1; xN = 9; Δx = 3;
          y1 = 0; yN = 5; Δy = 1;

          table = Join @@ Table[i, j, f[i, j], i, x1, xN, Δx, j, y1, yN, Δy]



          1, 0, f[1, 0], 1, 1, f[1, 1], 1, 2, f[1, 2], 1, 3,
          f[1, 3], 1, 4, f[1, 4], 1, 5, f[1, 5],

          4, 0, f[4, 0], 4, 1,
          f[4, 1], 4, 2, f[4, 2], 4, 3, f[4, 3], 4, 4, f[4, 4], 4, 5,
          f[4, 5],

          7, 0, f[7, 0], 7, 1, f[7, 1], 7, 2, f[7, 2], 7, 3,
          f[7, 3], 7, 4, f[7, 4], 7, 5, f[7, 5]




          Also



          table2 = ##, f @ ## & @@@ Tuples[Range[x1, xN, Δx], Range[y1, yN, Δy]]
          table2 == table



          True







          share|improve this answer











          $endgroup$



          x1 = 1; xN = 9; Δx = 3;
          y1 = 0; yN = 5; Δy = 1;

          table = Join @@ Table[i, j, f[i, j], i, x1, xN, Δx, j, y1, yN, Δy]



          1, 0, f[1, 0], 1, 1, f[1, 1], 1, 2, f[1, 2], 1, 3,
          f[1, 3], 1, 4, f[1, 4], 1, 5, f[1, 5],

          4, 0, f[4, 0], 4, 1,
          f[4, 1], 4, 2, f[4, 2], 4, 3, f[4, 3], 4, 4, f[4, 4], 4, 5,
          f[4, 5],

          7, 0, f[7, 0], 7, 1, f[7, 1], 7, 2, f[7, 2], 7, 3,
          f[7, 3], 7, 4, f[7, 4], 7, 5, f[7, 5]




          Also



          table2 = ##, f @ ## & @@@ Tuples[Range[x1, xN, Δx], Range[y1, yN, Δy]]
          table2 == table



          True








          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 4 hours ago

























          answered 4 hours ago









          kglrkglr

          189k10206424




          189k10206424





















              0












              $begingroup$

              This would be a nice answer (using the Outer product to create the 2D array):



              x1 = 1; xN = 9; dx = 3;
              y1 = 0; yN = 5; dy = 1;
              Partition[Flatten[
              Outer[Through[List, f[#1, #2]] &, Range[x1, xN, dx], Range[y1, yN, dy]]], 3]


              except that Outer returns too many levels -- hence the Flatten and Partition are needed to remove the extra brackets. Answer is the same as kglr's.






              share|improve this answer









              $endgroup$

















                0












                $begingroup$

                This would be a nice answer (using the Outer product to create the 2D array):



                x1 = 1; xN = 9; dx = 3;
                y1 = 0; yN = 5; dy = 1;
                Partition[Flatten[
                Outer[Through[List, f[#1, #2]] &, Range[x1, xN, dx], Range[y1, yN, dy]]], 3]


                except that Outer returns too many levels -- hence the Flatten and Partition are needed to remove the extra brackets. Answer is the same as kglr's.






                share|improve this answer









                $endgroup$















                  0












                  0








                  0





                  $begingroup$

                  This would be a nice answer (using the Outer product to create the 2D array):



                  x1 = 1; xN = 9; dx = 3;
                  y1 = 0; yN = 5; dy = 1;
                  Partition[Flatten[
                  Outer[Through[List, f[#1, #2]] &, Range[x1, xN, dx], Range[y1, yN, dy]]], 3]


                  except that Outer returns too many levels -- hence the Flatten and Partition are needed to remove the extra brackets. Answer is the same as kglr's.






                  share|improve this answer









                  $endgroup$



                  This would be a nice answer (using the Outer product to create the 2D array):



                  x1 = 1; xN = 9; dx = 3;
                  y1 = 0; yN = 5; dy = 1;
                  Partition[Flatten[
                  Outer[Through[List, f[#1, #2]] &, Range[x1, xN, dx], Range[y1, yN, dy]]], 3]


                  except that Outer returns too many levels -- hence the Flatten and Partition are needed to remove the extra brackets. Answer is the same as kglr's.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 2 hours ago









                  bill sbill s

                  54.5k377156




                  54.5k377156



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Mathematica Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      Use MathJax to format equations. MathJax reference.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f193773%2fhow-to-create-table-with-2d-function-values%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Era Viking Índice Início da Era Viquingue | Cotidiano | Sociedade | Língua | Religião | A arte | As primeiras cidades | As viagens dos viquingues | Viquingues do Oeste e Leste | Fim da Era Viquingue | Fontes históricas | Referências Bibliografia | Ligações externas | Menu de navegação«Sverige då!»«Handel I vikingetid»«O que é Nórdico Antigo»Mito, magia e religião na volsunga saga Um olhar sobre a trajetória mítica do herói sigurd«Bonden var den verklige vikingen»«Vikingatiden»«Vikingatiden»«Vinland»«Guerreiras de Óðinn: As Valkyrjor na Mitologia Viking»1519-9053«Esculpindo símbolos e seres: A arte viking em pedras rúnicas»1679-9313Historia - Tema: VikingarnaAventura e Magia no Mundo das Sagas IslandesasEra Vikinge

                      What's the metal clinking sound at the end of credits in Avengers: Endgame?What makes Thanos so strong in Avengers: Endgame?Who is the character that appears at the end of Endgame?What happens to Mjolnir (Thor's hammer) at the end of Endgame?The People's Ages in Avengers: EndgameWhat did Nebula do in Avengers: Endgame?Messing with time in the Avengers: Endgame climaxAvengers: Endgame timelineWhat are the time-travel rules in Avengers Endgame?Why use this song in Avengers: Endgame Opening Logo Sequence?Peggy's age in Avengers Endgame

                      Are there legal definitions of ethnicities/races? The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Legal definitions in the United StatesAre there truly legal limits on US interest rates?Are gender identity and sexual orientation federally protected?Why is there an apparent legal bias against digital services?What limits are there to the powers of individual judges in the United States legal system?Are women only scholarships legal under Irish / EU law?Is the term “race” defined by Public Law enacted by Congress of the United StatesIs there a legal definition of race in the US?Neighbors are spying for landlord on Renters is it legal?Are Protected Classes Bi-directional?