How to add Error Bars in fit curve line graph?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hey!
I want to put Error Bars in my line graph, I am using " fit " function on my data to smooth curves. And it is working fine. But I dont know how to put error bars on line graph while using ' fit " function. Below is the attached file of the dataset I am using and code.
clear all
clc
load('MCA_Disjoint_SegmentWise.mat')
Data1LDA = MCA_Disjoint(: , 1);
Data2LDA = MCA_Disjoint(: , 3);
Data3LDA = MCA_Disjoint(: , 5);
WindowSizes = 50:25:450;
WindowSizes = WindowSizes';
f1=fit(WindowSizes,Data1LDA,'cubicinterp');
f2=fit(WindowSizes,Data2LDA,'cubicinterp');
f3=fit(WindowSizes,Data3LDA,'cubicinterp');
figure
hold on
p(1,:) = plot(f1,WindowSizes,Data1LDA);
p(2,:) = plot(f2,WindowSizes,Data2LDA);
p(3,:) = plot(f3,WindowSizes,Data3LDA);
set(p(1,:),'LineWidth',2,...
'Color','black',...
'MarkerEdgeColor','k',...
'MarkerFaceColor',[.49 1 .63],...
'MarkerSize',20)
set(p(2,:),'LineWidth',2,...
'Color','red',...
'MarkerEdgeColor','r',...
'MarkerFaceColor',[.49 1 .63],...
'MarkerSize',20)
set(p(3,:),'LineWidth',2,...
'Color','blue',...
'MarkerEdgeColor','b',...
'MarkerFaceColor',[.49 1 .63],...
'MarkerSize',20)
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Interpolation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!