Row vectors and column vectors (Mathematica vs Matlab)Product between a column vector and a row vector - errorVectors and MatricesConfused how transpose works for listsMatrix Vector multiplicationDoubt about tensor producto of two columns vectorsCalling MATLAB from MathematicaMATLAB to Mathematica: coneplotMathematica-To-MATLAB Dictionary!Transformation Matlab assignments to Mathematica expressionsMathematica permutes indices when reading Matlab filesMathematica to Matlab
Easy way of generating a 50-150W load @12V
Mapping string into integers
Does a restocking fee still qualify as a business expense?
How to snip same part of screen as last time?
Did Terry Pratchett ever explain the inspiration behind the Luggage?
Is there a historical explanation as to why the USA people are so litigious compared to France?
What is the gold linker?
Hero battle game
Idiom for a situation or event that makes one poor or even poorer?
Consequences for Trump if the White House continues blocking witnesses and ignoring subpoenas?
What fantasy book has twins (except one's blue) and a cloaked ice bear on the cover?
the vs. value: what is the difference
My Guitar came with both metal and nylon strings, what replacement strings should I buy?
Does immunity to fear prevent a mummy's Dreadful Glare from paralyzing a character?
How to determine passing chords
I need an automatic way of making a lot of folders
Could an American state survive nuclear war?
Can there be an atomic nucleus where there are more protons than neutrons?
On notice period - coworker I need to train is giving me the silent treatment
Justify of equation to better explanation
Can we not simply connect a battery to a RAM to prevent data loss during power cuts?
avr-gcc keypad interfacing code problem
How do you determine the reach of a Monster's unarmed strikes?
How to treat unhandled exceptions? (Terminate the application vs. Keep it alive)
Row vectors and column vectors (Mathematica vs Matlab)
Product between a column vector and a row vector - errorVectors and MatricesConfused how transpose works for listsMatrix Vector multiplicationDoubt about tensor producto of two columns vectorsCalling MATLAB from MathematicaMATLAB to Mathematica: coneplotMathematica-To-MATLAB Dictionary!Transformation Matlab assignments to Mathematica expressionsMathematica permutes indices when reading Matlab filesMathematica to Matlab
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
.everyonelovesstackoverflowposition:absolute;height:1px;width:1px;opacity:0;top:0;left:0;pointer-events:none;
$begingroup$
As far as I know, Mathematica does not distinguish between row vectors and column vectors: all vectors are seen as lists. I know ways to bypass this as suggested here Product between a column vector and a row vector - error and get Matlab-style matrix multiplication.
My question is why Mathematica and Matlab behaves differently in this context? I have seen a clear explanation in https://groups.google.com/forum/#!forum/comp.soft-sys.math.mathematica several years ago but I cannot recall it anymore.
I guess it has to do with something fundamental.
core-language matlab
$endgroup$
add a comment
|
$begingroup$
As far as I know, Mathematica does not distinguish between row vectors and column vectors: all vectors are seen as lists. I know ways to bypass this as suggested here Product between a column vector and a row vector - error and get Matlab-style matrix multiplication.
My question is why Mathematica and Matlab behaves differently in this context? I have seen a clear explanation in https://groups.google.com/forum/#!forum/comp.soft-sys.math.mathematica several years ago but I cannot recall it anymore.
I guess it has to do with something fundamental.
core-language matlab
$endgroup$
2
$begingroup$
It's not so much that Mathematica doesn't distinguish between row and column vectors: it's more that it has a clear concept of tensors of arbitrary rank (something Matlab didn't really have last time I checked). A column vector is just an x 1
matrix and there's nothing stopping you from usingn x 1
matrices. But you don't have to if you don't want to. A normal list is just a rank 1 tensor. The documentation ofDot
, for example, states thatDot
contracts the innermost indices of two tensors. It doesn't matter what order of tensor you're using.
$endgroup$
– Sjoerd Smit
May 8 at 18:35
1
$begingroup$
As in a slightly different way expressed by @Szabolcs as well, row and column vectors are not vectors themselves. They are only two different notations for the same vector. A vector cannot be transposed, a matrix can. Transposing a row or column vector is just switching from row notation to column notation or conversely. In Mathematica, this is completely superfluous.
$endgroup$
– Fred Simons
May 8 at 18:52
add a comment
|
$begingroup$
As far as I know, Mathematica does not distinguish between row vectors and column vectors: all vectors are seen as lists. I know ways to bypass this as suggested here Product between a column vector and a row vector - error and get Matlab-style matrix multiplication.
My question is why Mathematica and Matlab behaves differently in this context? I have seen a clear explanation in https://groups.google.com/forum/#!forum/comp.soft-sys.math.mathematica several years ago but I cannot recall it anymore.
I guess it has to do with something fundamental.
core-language matlab
$endgroup$
As far as I know, Mathematica does not distinguish between row vectors and column vectors: all vectors are seen as lists. I know ways to bypass this as suggested here Product between a column vector and a row vector - error and get Matlab-style matrix multiplication.
My question is why Mathematica and Matlab behaves differently in this context? I have seen a clear explanation in https://groups.google.com/forum/#!forum/comp.soft-sys.math.mathematica several years ago but I cannot recall it anymore.
I guess it has to do with something fundamental.
core-language matlab
core-language matlab
edited May 8 at 18:35
Carl Lange
7,8071 gold badge21 silver badges51 bronze badges
7,8071 gold badge21 silver badges51 bronze badges
asked May 8 at 18:26
DimitrisDimitris
2,53314 silver badges34 bronze badges
2,53314 silver badges34 bronze badges
2
$begingroup$
It's not so much that Mathematica doesn't distinguish between row and column vectors: it's more that it has a clear concept of tensors of arbitrary rank (something Matlab didn't really have last time I checked). A column vector is just an x 1
matrix and there's nothing stopping you from usingn x 1
matrices. But you don't have to if you don't want to. A normal list is just a rank 1 tensor. The documentation ofDot
, for example, states thatDot
contracts the innermost indices of two tensors. It doesn't matter what order of tensor you're using.
$endgroup$
– Sjoerd Smit
May 8 at 18:35
1
$begingroup$
As in a slightly different way expressed by @Szabolcs as well, row and column vectors are not vectors themselves. They are only two different notations for the same vector. A vector cannot be transposed, a matrix can. Transposing a row or column vector is just switching from row notation to column notation or conversely. In Mathematica, this is completely superfluous.
$endgroup$
– Fred Simons
May 8 at 18:52
add a comment
|
2
$begingroup$
It's not so much that Mathematica doesn't distinguish between row and column vectors: it's more that it has a clear concept of tensors of arbitrary rank (something Matlab didn't really have last time I checked). A column vector is just an x 1
matrix and there's nothing stopping you from usingn x 1
matrices. But you don't have to if you don't want to. A normal list is just a rank 1 tensor. The documentation ofDot
, for example, states thatDot
contracts the innermost indices of two tensors. It doesn't matter what order of tensor you're using.
$endgroup$
– Sjoerd Smit
May 8 at 18:35
1
$begingroup$
As in a slightly different way expressed by @Szabolcs as well, row and column vectors are not vectors themselves. They are only two different notations for the same vector. A vector cannot be transposed, a matrix can. Transposing a row or column vector is just switching from row notation to column notation or conversely. In Mathematica, this is completely superfluous.
$endgroup$
– Fred Simons
May 8 at 18:52
2
2
$begingroup$
It's not so much that Mathematica doesn't distinguish between row and column vectors: it's more that it has a clear concept of tensors of arbitrary rank (something Matlab didn't really have last time I checked). A column vector is just a
n x 1
matrix and there's nothing stopping you from using n x 1
matrices. But you don't have to if you don't want to. A normal list is just a rank 1 tensor. The documentation of Dot
, for example, states that Dot
contracts the innermost indices of two tensors. It doesn't matter what order of tensor you're using.$endgroup$
– Sjoerd Smit
May 8 at 18:35
$begingroup$
It's not so much that Mathematica doesn't distinguish between row and column vectors: it's more that it has a clear concept of tensors of arbitrary rank (something Matlab didn't really have last time I checked). A column vector is just a
n x 1
matrix and there's nothing stopping you from using n x 1
matrices. But you don't have to if you don't want to. A normal list is just a rank 1 tensor. The documentation of Dot
, for example, states that Dot
contracts the innermost indices of two tensors. It doesn't matter what order of tensor you're using.$endgroup$
– Sjoerd Smit
May 8 at 18:35
1
1
$begingroup$
As in a slightly different way expressed by @Szabolcs as well, row and column vectors are not vectors themselves. They are only two different notations for the same vector. A vector cannot be transposed, a matrix can. Transposing a row or column vector is just switching from row notation to column notation or conversely. In Mathematica, this is completely superfluous.
$endgroup$
– Fred Simons
May 8 at 18:52
$begingroup$
As in a slightly different way expressed by @Szabolcs as well, row and column vectors are not vectors themselves. They are only two different notations for the same vector. A vector cannot be transposed, a matrix can. Transposing a row or column vector is just switching from row notation to column notation or conversely. In Mathematica, this is completely superfluous.
$endgroup$
– Fred Simons
May 8 at 18:52
add a comment
|
1 Answer
1
active
oldest
votes
$begingroup$
This is a limitation of MATLAB, as MATLAB is only able to work with matrices. It does not have true vectors. It cannot even represent a character array as a 1D array or a structure array as a single element—it always must be 2D.
Mathematica takes a much more general view. It works with arbitrary, $n$-index tensors. A 1-index tensor is called a vector. A 2-index one is called a matrix.
What is commonly called a "row vector" or a "column vector" is not really a vector. It is a $1times k$ or a $k times 1 $ matrix.
The dot product of a vector $v$ and a matrix $a$ is
$$u_j = sum_i v_i a_ij$$
The product of $a$ and $v$ is
$$u_i = sum_j a_ij v_j$$
In general, one can contract any two indices together, although Dot
specifically only contracts the last one of the first tensor with the first one of the last tensor. TensorContract
can do more general operations.
One particular limitation of Mathematica compared to MATLAB is that Mathematica cannot represent arrays where one of the dimensions is 0, e.g. a 0-by-n matrix. This is not due to the difference in philosophy that I described above. It's because Mathematca uses nested lists, so we can have a 1-by-0 but not a 0-by-1 thing.
$endgroup$
$begingroup$
I disagree that Matlab doesn't do 1D arrays — in fact I think it would be more correct to say that ALL Matlab arrays are 1D with an N-D size index as part of data structure. For instance, you can writex=1:1000000;
which is 1D and thenxx=reshape(x,[10 10 10 10 10 10]);
which is very very fast, to turn it into a 6D array. And contents in all Matlab arrays can be indexed with a unity-length index. Soxx(600)
is the same asx(600)
in the example I just mentioned.
$endgroup$
– Will Robertson
May 9 at 4:02
1
$begingroup$
@WillRobertson The fact that it's possible to do a 1D indexing has no bearing on how these quantities are treated during matrix multiplication. Also, while it can indeed handle higher dimensional arrays, the C APIs don't accept setting the dimension to 1. The minimum is 2. It's clear that MATLAB was designed with matrices and only matrices in mind, to the extent that even a char, cell or struct is a two-index quantity.
$endgroup$
– Szabolcs
May 9 at 6:44
$begingroup$
Fair enough. I see what you mean in that a vector of length N is not (conceptually) the same as a matrix of length 1xN or Nx1. And that the internal data structure is not the same as the mathematical meaning.
$endgroup$
– Will Robertson
May 11 at 5:34
add a comment
|
Your Answer
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/4.0/"u003ecc by-sa 4.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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f197958%2frow-vectors-and-column-vectors-mathematica-vs-matlab%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
This is a limitation of MATLAB, as MATLAB is only able to work with matrices. It does not have true vectors. It cannot even represent a character array as a 1D array or a structure array as a single element—it always must be 2D.
Mathematica takes a much more general view. It works with arbitrary, $n$-index tensors. A 1-index tensor is called a vector. A 2-index one is called a matrix.
What is commonly called a "row vector" or a "column vector" is not really a vector. It is a $1times k$ or a $k times 1 $ matrix.
The dot product of a vector $v$ and a matrix $a$ is
$$u_j = sum_i v_i a_ij$$
The product of $a$ and $v$ is
$$u_i = sum_j a_ij v_j$$
In general, one can contract any two indices together, although Dot
specifically only contracts the last one of the first tensor with the first one of the last tensor. TensorContract
can do more general operations.
One particular limitation of Mathematica compared to MATLAB is that Mathematica cannot represent arrays where one of the dimensions is 0, e.g. a 0-by-n matrix. This is not due to the difference in philosophy that I described above. It's because Mathematca uses nested lists, so we can have a 1-by-0 but not a 0-by-1 thing.
$endgroup$
$begingroup$
I disagree that Matlab doesn't do 1D arrays — in fact I think it would be more correct to say that ALL Matlab arrays are 1D with an N-D size index as part of data structure. For instance, you can writex=1:1000000;
which is 1D and thenxx=reshape(x,[10 10 10 10 10 10]);
which is very very fast, to turn it into a 6D array. And contents in all Matlab arrays can be indexed with a unity-length index. Soxx(600)
is the same asx(600)
in the example I just mentioned.
$endgroup$
– Will Robertson
May 9 at 4:02
1
$begingroup$
@WillRobertson The fact that it's possible to do a 1D indexing has no bearing on how these quantities are treated during matrix multiplication. Also, while it can indeed handle higher dimensional arrays, the C APIs don't accept setting the dimension to 1. The minimum is 2. It's clear that MATLAB was designed with matrices and only matrices in mind, to the extent that even a char, cell or struct is a two-index quantity.
$endgroup$
– Szabolcs
May 9 at 6:44
$begingroup$
Fair enough. I see what you mean in that a vector of length N is not (conceptually) the same as a matrix of length 1xN or Nx1. And that the internal data structure is not the same as the mathematical meaning.
$endgroup$
– Will Robertson
May 11 at 5:34
add a comment
|
$begingroup$
This is a limitation of MATLAB, as MATLAB is only able to work with matrices. It does not have true vectors. It cannot even represent a character array as a 1D array or a structure array as a single element—it always must be 2D.
Mathematica takes a much more general view. It works with arbitrary, $n$-index tensors. A 1-index tensor is called a vector. A 2-index one is called a matrix.
What is commonly called a "row vector" or a "column vector" is not really a vector. It is a $1times k$ or a $k times 1 $ matrix.
The dot product of a vector $v$ and a matrix $a$ is
$$u_j = sum_i v_i a_ij$$
The product of $a$ and $v$ is
$$u_i = sum_j a_ij v_j$$
In general, one can contract any two indices together, although Dot
specifically only contracts the last one of the first tensor with the first one of the last tensor. TensorContract
can do more general operations.
One particular limitation of Mathematica compared to MATLAB is that Mathematica cannot represent arrays where one of the dimensions is 0, e.g. a 0-by-n matrix. This is not due to the difference in philosophy that I described above. It's because Mathematca uses nested lists, so we can have a 1-by-0 but not a 0-by-1 thing.
$endgroup$
$begingroup$
I disagree that Matlab doesn't do 1D arrays — in fact I think it would be more correct to say that ALL Matlab arrays are 1D with an N-D size index as part of data structure. For instance, you can writex=1:1000000;
which is 1D and thenxx=reshape(x,[10 10 10 10 10 10]);
which is very very fast, to turn it into a 6D array. And contents in all Matlab arrays can be indexed with a unity-length index. Soxx(600)
is the same asx(600)
in the example I just mentioned.
$endgroup$
– Will Robertson
May 9 at 4:02
1
$begingroup$
@WillRobertson The fact that it's possible to do a 1D indexing has no bearing on how these quantities are treated during matrix multiplication. Also, while it can indeed handle higher dimensional arrays, the C APIs don't accept setting the dimension to 1. The minimum is 2. It's clear that MATLAB was designed with matrices and only matrices in mind, to the extent that even a char, cell or struct is a two-index quantity.
$endgroup$
– Szabolcs
May 9 at 6:44
$begingroup$
Fair enough. I see what you mean in that a vector of length N is not (conceptually) the same as a matrix of length 1xN or Nx1. And that the internal data structure is not the same as the mathematical meaning.
$endgroup$
– Will Robertson
May 11 at 5:34
add a comment
|
$begingroup$
This is a limitation of MATLAB, as MATLAB is only able to work with matrices. It does not have true vectors. It cannot even represent a character array as a 1D array or a structure array as a single element—it always must be 2D.
Mathematica takes a much more general view. It works with arbitrary, $n$-index tensors. A 1-index tensor is called a vector. A 2-index one is called a matrix.
What is commonly called a "row vector" or a "column vector" is not really a vector. It is a $1times k$ or a $k times 1 $ matrix.
The dot product of a vector $v$ and a matrix $a$ is
$$u_j = sum_i v_i a_ij$$
The product of $a$ and $v$ is
$$u_i = sum_j a_ij v_j$$
In general, one can contract any two indices together, although Dot
specifically only contracts the last one of the first tensor with the first one of the last tensor. TensorContract
can do more general operations.
One particular limitation of Mathematica compared to MATLAB is that Mathematica cannot represent arrays where one of the dimensions is 0, e.g. a 0-by-n matrix. This is not due to the difference in philosophy that I described above. It's because Mathematca uses nested lists, so we can have a 1-by-0 but not a 0-by-1 thing.
$endgroup$
This is a limitation of MATLAB, as MATLAB is only able to work with matrices. It does not have true vectors. It cannot even represent a character array as a 1D array or a structure array as a single element—it always must be 2D.
Mathematica takes a much more general view. It works with arbitrary, $n$-index tensors. A 1-index tensor is called a vector. A 2-index one is called a matrix.
What is commonly called a "row vector" or a "column vector" is not really a vector. It is a $1times k$ or a $k times 1 $ matrix.
The dot product of a vector $v$ and a matrix $a$ is
$$u_j = sum_i v_i a_ij$$
The product of $a$ and $v$ is
$$u_i = sum_j a_ij v_j$$
In general, one can contract any two indices together, although Dot
specifically only contracts the last one of the first tensor with the first one of the last tensor. TensorContract
can do more general operations.
One particular limitation of Mathematica compared to MATLAB is that Mathematica cannot represent arrays where one of the dimensions is 0, e.g. a 0-by-n matrix. This is not due to the difference in philosophy that I described above. It's because Mathematca uses nested lists, so we can have a 1-by-0 but not a 0-by-1 thing.
edited May 8 at 18:46
answered May 8 at 18:41
SzabolcsSzabolcs
172k18 gold badges469 silver badges1005 bronze badges
172k18 gold badges469 silver badges1005 bronze badges
$begingroup$
I disagree that Matlab doesn't do 1D arrays — in fact I think it would be more correct to say that ALL Matlab arrays are 1D with an N-D size index as part of data structure. For instance, you can writex=1:1000000;
which is 1D and thenxx=reshape(x,[10 10 10 10 10 10]);
which is very very fast, to turn it into a 6D array. And contents in all Matlab arrays can be indexed with a unity-length index. Soxx(600)
is the same asx(600)
in the example I just mentioned.
$endgroup$
– Will Robertson
May 9 at 4:02
1
$begingroup$
@WillRobertson The fact that it's possible to do a 1D indexing has no bearing on how these quantities are treated during matrix multiplication. Also, while it can indeed handle higher dimensional arrays, the C APIs don't accept setting the dimension to 1. The minimum is 2. It's clear that MATLAB was designed with matrices and only matrices in mind, to the extent that even a char, cell or struct is a two-index quantity.
$endgroup$
– Szabolcs
May 9 at 6:44
$begingroup$
Fair enough. I see what you mean in that a vector of length N is not (conceptually) the same as a matrix of length 1xN or Nx1. And that the internal data structure is not the same as the mathematical meaning.
$endgroup$
– Will Robertson
May 11 at 5:34
add a comment
|
$begingroup$
I disagree that Matlab doesn't do 1D arrays — in fact I think it would be more correct to say that ALL Matlab arrays are 1D with an N-D size index as part of data structure. For instance, you can writex=1:1000000;
which is 1D and thenxx=reshape(x,[10 10 10 10 10 10]);
which is very very fast, to turn it into a 6D array. And contents in all Matlab arrays can be indexed with a unity-length index. Soxx(600)
is the same asx(600)
in the example I just mentioned.
$endgroup$
– Will Robertson
May 9 at 4:02
1
$begingroup$
@WillRobertson The fact that it's possible to do a 1D indexing has no bearing on how these quantities are treated during matrix multiplication. Also, while it can indeed handle higher dimensional arrays, the C APIs don't accept setting the dimension to 1. The minimum is 2. It's clear that MATLAB was designed with matrices and only matrices in mind, to the extent that even a char, cell or struct is a two-index quantity.
$endgroup$
– Szabolcs
May 9 at 6:44
$begingroup$
Fair enough. I see what you mean in that a vector of length N is not (conceptually) the same as a matrix of length 1xN or Nx1. And that the internal data structure is not the same as the mathematical meaning.
$endgroup$
– Will Robertson
May 11 at 5:34
$begingroup$
I disagree that Matlab doesn't do 1D arrays — in fact I think it would be more correct to say that ALL Matlab arrays are 1D with an N-D size index as part of data structure. For instance, you can write
x=1:1000000;
which is 1D and then xx=reshape(x,[10 10 10 10 10 10]);
which is very very fast, to turn it into a 6D array. And contents in all Matlab arrays can be indexed with a unity-length index. So xx(600)
is the same as x(600)
in the example I just mentioned.$endgroup$
– Will Robertson
May 9 at 4:02
$begingroup$
I disagree that Matlab doesn't do 1D arrays — in fact I think it would be more correct to say that ALL Matlab arrays are 1D with an N-D size index as part of data structure. For instance, you can write
x=1:1000000;
which is 1D and then xx=reshape(x,[10 10 10 10 10 10]);
which is very very fast, to turn it into a 6D array. And contents in all Matlab arrays can be indexed with a unity-length index. So xx(600)
is the same as x(600)
in the example I just mentioned.$endgroup$
– Will Robertson
May 9 at 4:02
1
1
$begingroup$
@WillRobertson The fact that it's possible to do a 1D indexing has no bearing on how these quantities are treated during matrix multiplication. Also, while it can indeed handle higher dimensional arrays, the C APIs don't accept setting the dimension to 1. The minimum is 2. It's clear that MATLAB was designed with matrices and only matrices in mind, to the extent that even a char, cell or struct is a two-index quantity.
$endgroup$
– Szabolcs
May 9 at 6:44
$begingroup$
@WillRobertson The fact that it's possible to do a 1D indexing has no bearing on how these quantities are treated during matrix multiplication. Also, while it can indeed handle higher dimensional arrays, the C APIs don't accept setting the dimension to 1. The minimum is 2. It's clear that MATLAB was designed with matrices and only matrices in mind, to the extent that even a char, cell or struct is a two-index quantity.
$endgroup$
– Szabolcs
May 9 at 6:44
$begingroup$
Fair enough. I see what you mean in that a vector of length N is not (conceptually) the same as a matrix of length 1xN or Nx1. And that the internal data structure is not the same as the mathematical meaning.
$endgroup$
– Will Robertson
May 11 at 5:34
$begingroup$
Fair enough. I see what you mean in that a vector of length N is not (conceptually) the same as a matrix of length 1xN or Nx1. And that the internal data structure is not the same as the mathematical meaning.
$endgroup$
– Will Robertson
May 11 at 5:34
add a comment
|
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f197958%2frow-vectors-and-column-vectors-mathematica-vs-matlab%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
2
$begingroup$
It's not so much that Mathematica doesn't distinguish between row and column vectors: it's more that it has a clear concept of tensors of arbitrary rank (something Matlab didn't really have last time I checked). A column vector is just a
n x 1
matrix and there's nothing stopping you from usingn x 1
matrices. But you don't have to if you don't want to. A normal list is just a rank 1 tensor. The documentation ofDot
, for example, states thatDot
contracts the innermost indices of two tensors. It doesn't matter what order of tensor you're using.$endgroup$
– Sjoerd Smit
May 8 at 18:35
1
$begingroup$
As in a slightly different way expressed by @Szabolcs as well, row and column vectors are not vectors themselves. They are only two different notations for the same vector. A vector cannot be transposed, a matrix can. Transposing a row or column vector is just switching from row notation to column notation or conversely. In Mathematica, this is completely superfluous.
$endgroup$
– Fred Simons
May 8 at 18:52