creating a matrix from a vector

9 vues (au cours des 30 derniers jours)
Kiyoko Christian Mwizu
Kiyoko Christian Mwizu le 8 Sep 2020
Modifié(e) : Bruno Luong le 8 Sep 2020
I have a vector v2=linspace(-30,10,100)
I want to create a matrix M1 that has three columns, each of which is v2 and another matrix M2 that has three rows, each of which is the transpose of v2. I am lost on how to solve this problem. Please help.

Réponse acceptée

Bruno Luong
Bruno Luong le 8 Sep 2020
Modifié(e) : Bruno Luong le 8 Sep 2020
v2=linspace(-30,10,100) % This iis a ROW vector not column
M1 = [v2.', v2.', v2.']
M2 = [v2; v2; v2]

Plus de réponses (0)

Catégories

En savoir plus sur Data Types dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by