How to plot data from an external MAT file against a time domain?

6 ビュー (過去 30 日間)
Mason Reilly
Mason Reilly 2024 年 3 月 13 日
回答済み: Chunru 2024 年 3 月 13 日
I have a very large set of data that is meant to represent an ICP composite signal that must be plotted against a time domain. When I try loading in the data and plotting it against time, it informs me that the vectors are not of the same length. I've tried linspace and setting the icpcomposite as an array of zeros set to the length of 't', but nothing seems to work so far.
  1 件のコメント
VBBV
VBBV 2024 年 3 月 13 日
Please share/attach the data file

サインインしてコメントする。

回答 (1 件)

Chunru
Chunru 2024 年 3 月 13 日
If you want to plot whole time series:
ns = length(icpcomposite);
t = (0:ns-1)/fs;
plot(t, icpcomposite);
If you want to plot a portion of data:
ns = 1000; % for example (<= total samples in data)
t = (0:ns-1)/fs;
plot(t, icpcomposite(1:ns));

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by