当前位置:网站首页>将数据导入到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是第一列到第四列。()'表示将括号内的数据进行转置。
第二种方式
先在主页中点击,新建变量;然后修改变量名;然后粘贴数据。
然后在命令行窗口输入命令,保存数据

边栏推荐
- 搞清信息化是什么,让企业转型升级走上正确的道路
- 饮食干预减轻癌症治疗相关症状和毒性
- 微信小程序入门记录
- Technology blog | how to communicate using SSE
- 基于Anaconda的模块安装与注意事项
- C Getting Started tutorial
- Access to foreign lead domain name mailbox
- Do you know why the PCB produces tin beads? 2021-09-30
- @The difference between resource and @autowired annotation, why recommend @resource?
- 1742. 盒子中小球的最大数量
猜你喜欢

The method of judging whether triode can amplify AC signal

Do you know why the PCB produces tin beads? 2021-09-30

剑指 Offer II 027. 回文链表

挖掘微生物暗物质——新思路

“空间转换”显著提升陡崖点云的地面点提取质量

基于地面点稀少的LiDAR点云的茂密森林蓄积量估算

Function template_ Class template

Elk + filebeat log parsing, log warehousing optimization, logstash filter configuration attribute

realsense d455 semantic_slam实现语义八叉树建图

差点被这波Handler 面试连环炮带走~
随机推荐
Manufacturing process of PCB 2021-10-11
搞清信息化是什么,让企业转型升级走上正确的道路
使用报文和波形记录分析仪RoyalScope的帧统计功能排查CAN总线偶发性故障
npm install 报错 : gyp ERR! configure error
Hisilicon 3559 sample parsing: Vio
Four software 2021-10-14 suitable for beginners to draw PCB
AttributeError: ‘Upsample‘ object has no attribute ‘recompute_scale_factor‘
Collection of common terms and meanings in forestry investigation based on lidar
Understand the reasons for impedance matching of PCB circuit board 2021-10-07
Take you through the normalization flow of GaN
Modular programming of LCD1602 LCD controlled by single chip microcomputer
Pcb|about FPC reinforcement type
基于RBAC 的SAAS系统权限设计
@Resource和@Autowired注解的不同,为什么推荐@Resource?
OAuth 2.0一键登录那些事
函数模板_类模板
如何用svn新建属于自己的分支
剑指 Offer II 027. 回文链表
传统的IO存在什么问题?为什么引入零拷贝的?
Cglib dynamic proxy