Please help, i have the idea of what I'm wanting to find but do not know how to actually code this!
조회 수: 7 (최근 30일)
이전 댓글 표시
I have a file but do not know how to call for the file in the code and get it to process what I am looking for which is a subplot of the EMG signal graphed over time and an amplitude spectrum of the EMG signal. The sampling frequency is 1000Hz of the graph/data.
댓글 수: 1
John D'Errico
2021년 12월 4일
It is time for you to spend the time to learn MATLAB. How do you read in data from a file?
help textread
help load
답변 (1개)
Dave B
2021년 12월 4일
편집: Dave B
2021년 12월 4일
How about something like this:
% You might consider readmatrix or readtable instead of load...
% But load works for such simple files.
load('EMG.txt')
fs = 1000; % 1000 elements of EMG is 1 second
t = linspace(0, numel(EMG)/fs, numel(EMG));
plot(t, EMG)
% --- you could stop here if you want --- %
xlabel('Time (s)')
ylabel('Amplitude')
title('My EMG Signal', 'Courtesy of MATLAB Answers')
set(gca, 'YGrid', 'on', 'TickDir', 'none', 'TitleHorizontalAlignment', 'left')
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Measurements and Feature Extraction에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
