导出matlab数据mat中某个向量组,从Matlab导出多个向量到文件(Exporting multiple vectors to file from Matlab)...

Every vector should represent a row. Vector elements ->columns, Vectors -> rows.

I'm not sure what you mean by that without any further context. Anyway, saving variables for later use is easy enough. Here's a little demo:

>> x = 1:5

x =

1 2 3 4 5

>> y = 5:-1:1

y =

5 4 3 2 1

>> whos

Name Size Bytes Class Attributes

x 1x5 40 double

y 1x5 40 double

>> save('myvars')

>> clear

>> whos

>> x

Undefined function or variable 'x'.

>> y

Undefined function or variable 'y'.

>> load('myvars')

>> whos

Name Size Bytes Class Attributes

x 1x5 40 double

y 1x5 40 double

>> x

x =

1 2 3 4 5

>> y

y =

5 4 3 2 1

This will create a file myvars.mat which holds the values of all currently defined variables.

EDIT in response to your comment:

So let's say we have these N vectors V1,V2,...VN, you can create the desired matrix by issueing

M = [V1;V2;...;VN]

Now save it to a file with

save('mymatrix', 'M')

This will create a file mymatrix.mat which holds the matrix M for later use. To load it into the workspace, simply issue

load('mymatrix')

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值