i wanted the slope with respect to time frame
조회 수: 4 (최근 30일)
이전 댓글 표시
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/236897/image.jpeg)
I have attached my data file as well.
How do i calculate the slope of channels 1 to 15 indivijually and place the values in a different table and perhaps even plot to visually see it????
- Slope: the value that fits a regression line to the given data set.
- https://journals.plos.org/plosone/article/figure/image?size=medium&id=info:doi/10.1371/journal.pone.0208843.g007
Something similar to the url i have posted above.
Thank you
댓글 수: 2
Jan
2019년 9월 4일
The question is not clear. What are "channels 1 to 15"? Why did you highlight the first cell? What are "HbO" values? Where do we find the "time frame"?
채택된 답변
Star Strider
2019년 9월 4일
First, negative values for haemoglobin or oxyhaemoglobin do not make sense physiologically.
I have no idea what you want to do, so start with:
D = load('HbO_Good_channels.mat');
HbO = D.HbO_good_channel;
Ts = 35/size(HbO,1); % Create A Sampling Interval, Since None Are Provided
T = linspace(0, size(HbO,1), size(HbO,1))*Ts; % Time Vector
lgdc = sprintfc('Ch %2d', 1:size(HbO,2)); % Legend String Cell Array (Channels)
figure
plot(T, HbO)
grid
xlabel('Time')
ylabel('HbO')
legend(lgdc, 'Location','eastoutside')
for k = 1:size(HbO,2)
cfs(k,:) = polyfit(T(:), HbO(:,k), 3); % Coefficient Vectors: ‘polyfit’
end
figure
hold all
for k = 1:size(HbO,2)
pf(:,k) = polyval(cfs(k,:), T(:)); % Evaluate Fitted Polynomials
plot(T, pf(:,k))
end
hold off
grid
xlabel('Time')
ylabel('Regression Fit')
legend(lgdc)
Experiment to get the resultl you want.
댓글 수: 20
Star Strider
2019년 9월 20일
I have no idea. As I mentioned before, I have very little recent experience with classification, and essentially no experience with SVM.
I suggest that you open a new Question on this.
참고 항목
카테고리
Help Center 및 File Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!