Skip to main content
added 1 character in body
Source Link
Jagra
  • 14.7k
  • 1
  • 40
  • 84

Perhaps I've missed something, but you seem to just want to append a vector (which you have already calculated) to a matrix.

Documentation for Append[] shows how to do it:

enter image description here

For your case since you already have a and b:

MapThread[Append, {a, b}] // MatrixForm 

enter image description here

A different approach enables you to join matrixes to make longer rows:

The following makes a 2 couldcolumn matrix from your b

b2 = Transpose[{b, b}]; b2 // MatrixForm 

enter image description here

The documentation for Join[] shows the way to do what you asked for in your comment:

enter image description here

Note that the 2 at the end of the Join[] operates as a level specification.

For your case:

Join[a, b2, 2]; % // MatrixForm 

enter image description here

Perhaps I've missed something, but you seem to just want to append a vector (which you have already calculated) to a matrix.

Documentation for Append[] shows how to do it:

enter image description here

For your case since you already have a and b:

MapThread[Append, {a, b}] // MatrixForm 

enter image description here

A different approach enables you to join matrixes to make longer rows:

The following makes a 2 could matrix from your b

b2 = Transpose[{b, b}]; b2 // MatrixForm 

enter image description here

The documentation for Join[] shows the way to do what you asked for in your comment:

enter image description here

Note that the 2 at the end of the Join[] operates as a level specification.

For your case:

Join[a, b2, 2]; % // MatrixForm 

enter image description here

Perhaps I've missed something, but you seem to just want to append a vector (which you have already calculated) to a matrix.

Documentation for Append[] shows how to do it:

enter image description here

For your case since you already have a and b:

MapThread[Append, {a, b}] // MatrixForm 

enter image description here

A different approach enables you to join matrixes to make longer rows:

The following makes a 2 column matrix from your b

b2 = Transpose[{b, b}]; b2 // MatrixForm 

enter image description here

The documentation for Join[] shows the way to do what you asked for in your comment:

enter image description here

Note that the 2 at the end of the Join[] operates as a level specification.

For your case:

Join[a, b2, 2]; % // MatrixForm 

enter image description here

More extensive answer
Source Link
Jagra
  • 14.7k
  • 1
  • 40
  • 84

Perhaps I've missed something, but you seem to just want to append a vector (which you have already calculated) to a matrix.

Documentation for Append[] shows how to do it:

![enter image description here][2]enter image description here

For your case since you already have a and b:

MapThread[Append, {a, b}] // MatrixForm 

![enter image description here][1] [1]enter image description here

A different approach enables you to join matrixes to make longer rows: https

The following makes a 2 could matrix from your b

b2 = Transpose[{b, b}]; b2 // MatrixForm 

enter image description here

The documentation for Join[] shows the way to do what you asked for in your comment://i.sstatic.net/4544h

enter image description here

Note that the 2 at the end of the Join[] operates as a level specification.png [2]: https

For your case://i.sstatic.net/BgFUU.png

Join[a, b2, 2]; % // MatrixForm 

enter image description here

Perhaps I've missed something, but you seem to just want to append a vector (which you have already calculated) to a matrix.

Documentation for Append[] shows how to do it:

![enter image description here][2]

For your case since you already have a and b:

MapThread[Append, {a, b}] // MatrixForm 

![enter image description here][1] [1]: https://i.sstatic.net/4544h.png [2]: https://i.sstatic.net/BgFUU.png

Perhaps I've missed something, but you seem to just want to append a vector (which you have already calculated) to a matrix.

Documentation for Append[] shows how to do it:

enter image description here

For your case since you already have a and b:

MapThread[Append, {a, b}] // MatrixForm 

enter image description here

A different approach enables you to join matrixes to make longer rows:

The following makes a 2 could matrix from your b

b2 = Transpose[{b, b}]; b2 // MatrixForm 

enter image description here

The documentation for Join[] shows the way to do what you asked for in your comment:

enter image description here

Note that the 2 at the end of the Join[] operates as a level specification.

For your case:

Join[a, b2, 2]; % // MatrixForm 

enter image description here

even more detail
Source Link
Jagra
  • 14.7k
  • 1
  • 40
  • 84

Perhaps I've missed something, but you seem to just want to append a vector (which you have already calculated) to a matrix.

Documentation for Append[] shows how to do it:

![enter image description here][2]

For your case since you already have a and b:

MapThread[Append, {a, b}] // MatrixForm 

![enter image description here][1] [1]: https://i.sstatic.net/4544h.png [2]: https://i.sstatic.net/BgFUU.png

Documentation for Append[] shows how to do it:

![enter image description here][2]

For your case since you already have a and b:

MapThread[Append, {a, b}] // MatrixForm 

![enter image description here][1] [1]: https://i.sstatic.net/4544h.png [2]: https://i.sstatic.net/BgFUU.png

Perhaps I've missed something, but you seem to just want to append a vector (which you have already calculated) to a matrix.

Documentation for Append[] shows how to do it:

![enter image description here][2]

For your case since you already have a and b:

MapThread[Append, {a, b}] // MatrixForm 

![enter image description here][1] [1]: https://i.sstatic.net/4544h.png [2]: https://i.sstatic.net/BgFUU.png

Source Link
Jagra
  • 14.7k
  • 1
  • 40
  • 84
Loading