Load and plot .mat file

3 次查看(过去 30 天)
Muhammad Mirza Murad
评论: Voss 2022-1-14
I need to load these files and plot them in frequency domain but currently this error keep appearing:
x = load('signal1.mat');
y = load('signal2.mat');
plot(x, y);
Error in q4 (line 3)
plot(x, y);
How to solve this problem?

回答(1 个)

Voss
Voss 2022-1-13
x = load('signal1.mat')
x = struct with fields:
x: [0.0049 0.0044 0.0018 3.6715e-04 1.3332e-04 1.4758e-04 0.0013 0.0017 1.1187e-05 -6.7999e-04 -3.2793e-04 9.1101e-05 0.0027 0.0044 0.0031 0.0024 7.0672e-04 -0.0016 -4.1761e-04 5.5479e-04 -4.1560e-04 -4.5405e-04 -0.0017 -0.0033 -0.0017 2.5324e-04 … ]
y = load('signal2.mat')
y = struct with fields:
x: [0.0066 0.0027 0.0037 4.2831e-04 0.0021 0.0022 0.0028 0.0046 2.9883e-04 0.0011 -0.0023 5.7575e-04 -0.0017 0.0022 -1.9579e-06 -0.0017 -0.0023 -0.0039 -0.0011 -0.0026 0.0017 -0.0023 -0.0012 -0.0038 -0.0019 -0.0015 -1.1707e-04 0.0021 -0.0016 … ]
plot(x.x,y.x,'.')

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by