matlab 矩阵 矢量场,Matlab将矢量转换为矩阵(Matlab turning vectors into a matrix)

这篇博客讨论了如何在Matlab中将三个列向量转换为矩阵。作者遇到的问题是尝试将[v1 v2 v3]形式的列向量组合成一个矩阵,但得到的是每个向量的描述,而非实际数值。解决方案是直接使用[m = [v1 v2 v3];]创建所需的矩阵。
摘要由CSDN通过智能技术生成

Matlab将矢量转换为矩阵(Matlab turning vectors into a matrix)

我不确切地知道如何用这个问题来表达,但我有3个列向量,我试图将它们变成矩阵,这样矩阵基本上看起来像[v1 v2 v2]

其中每个向量的长度明显大于1。

有自动方法吗?

现在,我要走了

matrix{1} = v1;

matrix{2} = v2;

matrix{3} = v3;

但这不起作用,因为当我打印出我的矩阵时,我得到了

matrix =

[50x1 double] [50x1 double] [50x1 double]

而不是实际的数字。

I don't know exactly how to phrase this question, but I have 3 column vectors, and I'm trying to turn them into a matrix such that, the matrix would basically look like [v1 v2 v2]

where the length of each vector is obviously more than 1.

Is there an automatic way to do this?

Right now, I'm going

matrix{1} = v1;

matrix{2} = v2;

matrix{3} = v3;

but this doesn't work work, because when I print out my matrix I get

matrix =

[50x1 double] [50x1 double] [50x1 double]

instead of the actual numbers.

原文:https://stackoverflow.com/questions/12850745

2020-07-04 09:07

满意答案

假设您的列向量定义为:

>>v1 = [1; 2; 3];

>>v2 = [4; 5; 6];

>>v3 = [7; 8; 9];

那么你的矩阵就是这些列的行向量:

>>m = [v1 v2 v3];

Let's say your column vectors are defined as:

>>v1 = [1; 2; 3];

>>v2 = [4; 5; 6];

>>v3 = [7; 8; 9];

Then your matrix is simply a row vector of these columns:

>>m = [v1 v2 v3];

2013-02-21

相关问答

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值