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

边栏推荐
- [Video] ffplay uses MJPEG format to play USB camera
- Do you know why the PCB produces tin beads? 2021-09-30
- Elk + filebeat log parsing, log warehousing optimization, logstash filter configuration attribute
- 基于Anaconda的模块安装与注意事项
- 基于地面点稀少的LiDAR点云的茂密森林蓄积量估算
- El input to add words to the tail
- Home environment monitoring system design (PC version) (mobile app version to be determined)
- FairMOT yolov5s转onnx
- Requirements for Power PCB circuit board design 2021-11-09
- C reads XML on the web
猜你喜欢

VectorDraw Developer Framework 10.10

无“米”,也能煮“饭”利用“点云智绘”反演机载LiDAR林下缺失地面点攻略

How to use printf of 51 single chip microcomputer

One "stone" and two "birds", PCA can effectively improve the dilemma of missing some ground points under the airborne lidar forest

The fourth floor is originally the fourth floor. Let's have a look

VectorDraw Web Library 10.10

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

How to select lead-free and lead-free tin spraying for PCB? 2021-11-16

基于Anaconda的模块安装与注意事项

挖掘微生物暗物质——新思路
随机推荐
Microsoft Office Word 远程命令执行漏洞(CVE-2022-30190)分析与利用
用函数的递归来解决几道有趣的题
Pytorch遇到的坑:为什么模型训练时,L1loss损失无法下降?
1742. 盒子中小球的最大数量
STL tutorial 4- input / output stream and object serialization
基于Anaconda的模块安装与注意事项
Cglib dynamic proxy
新版USBCAN卡CAN分析仪的CAN&CANFD综合测试分析软件LKMaster主要功能介绍
"Spatial transformation" significantly improves the quality of ground point extraction of cliff point cloud
C#获取exe的版本号-文件版本and程序集版本
【QT】qtcreator便捷快捷键以及QML介绍
Storage of Galileo broadcast ephemeris in rtklib-b33
【深度学习 轻量型backbone】2022 EdgeViTs CVPR
Take you through the normalization flow of GaN
如何用svn新建属于自己的分支
The fourth floor is originally the fourth floor. Let's have a look
Fairmot yolov5s to onnx
C reads XML on the web
基于地面点稀少的LiDAR点云的茂密森林蓄积量估算
CAN总线工作状况和信号质量“体检”