To plot mean signal(mean of multiple signals) in matlab figure?

8 ビュー (過去 30 日間)
SUDEEP SINGH RAWAT
SUDEEP SINGH RAWAT 2024 年 2 月 21 日
編集済み: Hassaan 2024 年 2 月 21 日
Hi there, i have a mix of 168 signals. i want to plot the single signal( mean of all 168 signals) using matlab figure (through data inspector). How can it be done? or any other way of doing it?
please help!

採用された回答

Hassaan
Hassaan 2024 年 2 月 21 日
編集済み: Hassaan 2024 年 2 月 21 日
@SUDEEP SINGH RAWAT You are using simulink?. To what I currently understand about your query.
If you are planning to use Simulink Data Inspector and Plot Data [see the below link]:
If you are planning to use MATLAB Workspace and Plot Data:
% Example: Assuming you have a matrix 'signals' of size [168 x N]
% Step 1: Suppose 'signals' is your matrix with 168 signals
% For demonstration, let's create a sample 'signals' matrix
N = 1000; % Number of data points in each signal
signals = rand(168, N) + repmat(linspace(0, 1, N), 168, 1); % Sample data
% Step 2: Compute the mean signal
meanSignal = mean(signals, 1); % Averages across the rows
% Step 3: Plot the mean signal
figure; % Creates a new figure window
plot(meanSignal);
title('Mean of 168 Signals');
xlabel('Time or Data Point Index');
ylabel('Mean Signal Value');
% Optionally, to use Data Inspector, you can send the data to the workspace
assignin('base', 'meanSignal', meanSignal);
-----------------------------------------------------------------------------------------------------------------------------------------------------
If you find the solution helpful and it resolves your issue, it would be greatly appreciated if you could accept the answer. Also, leaving an upvote and a comment are also wonderful ways to provide feedback.
It's important to note that the advice and code are based on limited information and meant for educational purposes. Users should verify and adapt the code to their specific needs, ensuring compatibility and adherence to ethical standards.
Professional Interests
  • Technical Services and Consulting
  • Embedded Systems | Firmware Developement | Simulations
  • Electrical and Electronics Engineering
Feel free to contact me.

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by