creating a matrix from a vector

20 次查看(过去 30 天)
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.

采纳的回答

Bruno Luong
Bruno Luong 2020-9-8
编辑:Bruno Luong 2020-9-8
v2=linspace(-30,10,100) % This iis a ROW vector not column
M1 = [v2.', v2.', v2.']
M2 = [v2; v2; v2]

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Multidimensional Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by