当前位置:网站首页>将数据导入到MATLAB
将数据导入到MATLAB
2022-06-25 06:42:00 【傻童:CPU】
将数据导入到MATLAB
将数据导入到MATLAB中有二种方式。
第一种:直接使用MATLAB读Excel文件
例如
Excel表格
num=xlsread('data1.xlsx','Sheet1','A1:E13');%读入Excel文件
input_train=num(1:8,1:4)';%1到8行,1到4列
output_train=num(1:8,5)';%1到8行,第5列
input_test=num(9:13,1:4)';%9到13行,1到4列
output_test=num(9:13,5)';%9到13行,第5列
其中,num:只是一个定义的名称而已,你可以把他定义成你所想想要的名称即可,比如:settlement;data1:是你自己给这个excel起的名字;xlsx:这是excel的文件后缀,如果你是更早的版本可能是xls,注意甄别即可;Sheet1:这个是你的数据在excel的第几页里面;A1:E13:这个是你的数据在excel所处的全部范围。num(1:8,1:4):1:8的意思是第一行到第八行,1:4是第一列到第四列。()'表示将括号内的数据进行转置。
第二种方式
先在主页中点击,新建变量;然后修改变量名;然后粘贴数据。
然后在命令行窗口输入命令,保存数据
边栏推荐
- 基于地面点稀少的LiDAR点云的茂密森林蓄积量估算
- Pcb|about FPC reinforcement type
- C WinForm panel custom picture and text
- “空间转换”显著提升陡崖点云的地面点提取质量
- MySQL简单权限管理
- (tool class) quickly add time to code in source insight
- 判断用户是否是第一次进入某个页面
- 点云智绘在智慧工地中的应用
- AttributeError: ‘Upsample‘ object has no attribute ‘recompute_ scale_ factor‘
- c# winform panel自定义图片和文字
猜你喜欢
函数模板_类模板
VSCode很好,但我以后不会再用了
Pcb|about FPC reinforcement type
海思3559 sample解析:vio
How much do you know about electronic components on PCB?
[distillation] pointdistiller: structured knowledge distillationwards efficient and compact 3D detection
Three years of continuous decline in revenue, Tiandi No. 1 is trapped in vinegar drinks
This article uses pytorch to build Gan model!
Leetcode daily question - 515 Find the maximum value in each tree row
How to resize an image in C #
随机推荐
Home environment monitoring system design (PC version) (mobile app version to be determined)
Leetcode daily question - 515 Find the maximum value in each tree row
OpenMP入门
This article uses pytorch to build Gan model!
Modular programming of oled12864 display controlled by single chip microcomputer
AttributeError: ‘Upsample‘ object has no attribute ‘recompute_scale_factor‘
Understand the reasons for impedance matching of PCB circuit board 2021-10-07
挖掘微生物暗物质——新思路
Terms and concepts related to authority and authentication system
VSCode很好,但我以后不会再用了
函数模板_类模板
How to resize an image in C #
SSL证书免费获取教程
OAuth 2.0一键登录那些事
Six causes of PCB disconnection 2021-10-20
WinForm实现窗口始终在顶层
Insert and sort the linked list [dummy unified operation + broken chain core - passive node]
Elk + filebeat log parsing, log warehousing optimization, logstash filter configuration attribute
Cglib dynamic proxy
50. Pow(x, n)-快速幂