matlab引用excel数据做折线图通用的代码
时间: 2023-12-03 13:02:33 浏览: 113
以下是一个基本的 MATLAB 代码,可用于将 Excel 数据绘制成折线图:
```matlab
% 读取 Excel 文件
filename = 'data.xlsx';
sheet = 1;
xlRange = 'A1:B10';
data = xlsread(filename, sheet, xlRange);
% 绘制折线图
x = data(:,1);
y = data(:,2);
plot(x,y);
```
请注意,这只是一个基本示例,需要根据您的数据进行适当的更改。
阅读全文
相关推荐














