Error Bars Plotyy
Contents |
Support Answers MathWorks Search MathWorks.com MathWorks Answers Support MATLAB Answers™ MATLAB Central Community Home MATLAB Answers File Exchange Cody Blogs Newsreader Link Exchange ThingSpeak Anniversary Home Ask Answer Browse More Contributors Recent Activity Flagged Content Flagged as Spam Help MATLAB matlab errorbar two y axes Central Community Home MATLAB Answers File Exchange Cody Blogs Newsreader Link Exchange ThingSpeak Anniversary Home
Errorbarxy Matlab
Ask Answer Browse More Contributors Recent Activity Flagged Content Flagged as Spam Help Trial software Clement Wong (view profile) 5 questions 1 answer plotyy color 0 accepted answers Reputation: 0 Vote0 Plotyy and error bars Asked by Clement Wong Clement Wong (view profile) 5 questions 1 answer 0 accepted answers Reputation: 0 on 3 Aug 2011 Accepted Answer by Patrick Kalita Patrick errorbar matlab Kalita (view profile) 0 questions 141 answers 62 accepted answers Reputation: 414 173 views (last 30 days) 173 views (last 30 days) I'd like to do a plotyy function, and I have confidence intervals for each point of my data. I can't seem to figure out a way to do both of these at once. My x data is stored in an array RC, and the two y data are in arrays L and D. The
Matlab Plotyy
confidence intervals are in ciL and ciD, and are not necessarily symmetric. Is there an easy way to add these as error bars to my plot? 2 Comments Show all comments Jan Simon Jan Simon (view profile) 57 questions 6,864 answers 2,079 accepted answers Reputation: 13,884 on 3 Aug 2011 Direct link to this comment: https://www.mathworks.com/matlabcentral/answers/12946#comment_28683 If you post the code you have currently, it would be easier to insert the changes. Clement Wong Clement Wong (view profile) 5 questions 1 answer 0 accepted answers Reputation: 0 on 3 Aug 2011 Direct link to this comment: https://www.mathworks.com/matlabcentral/answers/12946#comment_28850 The code looks something like this: x = 1; for rc = 1000:1000:10000 [beta,r,j,covb,mse] = nlfin(parameters including rc); ci = nlparci(beta,r,'covar',covb); L(x) = beta(2); D(x) = beta(3); ciL(x,:) = ci(2,:); ciD(x,:) = ci(3,:); x = x+1; end L,D,ciL,ciD are all preallocated for speed. But the idea is that now, I have the confidence intervals for all 10 data points as I sweep rc. RC goes from 1,000 to 10,000 in 1,000 step size. I'm plotting the values for L and D against RC using plotyy(RC,L,RC,D,semilogx). ciL and ciD contain the confidence intervals for each point, in order. That is, if L(1) is 5, then ciL(1) could be something like [3 8]. I hope this makes sense. Tags error barsplotyy Products MATLAB Related Content 1 Answer Patrick Kal
Support Answers MathWorks Search MathWorks.com MathWorks Answers Support MATLAB Answers™ MATLAB Central Community Home MATLAB Answers File Exchange Cody Blogs Newsreader Link Exchange ThingSpeak Anniversary Home Ask Answer Browse More Contributors Recent Activity Flagged Content Flagged as Spam Help MATLAB Central Community Home MATLAB Answers File Exchange Cody Blogs Newsreader Link Exchange ThingSpeak Anniversary Home Ask Answer Browse More Contributors Recent Activity Flagged Content Flagged as Spam Help Trial software Chris E. (view profile) 35 questions 9 answers 4 accepted answers Reputation: 10 Vote0 Using plotyy with error bars and https://www.mathworks.com/matlabcentral/answers/12946-plotyy-and-error-bars 3 sets of data... Asked by Chris E. Chris E. (view profile) 35 questions 9 answers 4 accepted answers Reputation: 10 on 2 Jul 2013 Accepted Answer by Chris E. Chris E. (view profile) 35 questions 9 answers 4 accepted answers Reputation: 10 25 views (last 30 days) 25 views (last 30 days) Hello All,I have an issue with trying to make a https://www.mathworks.com/matlabcentral/answers/80947-using-plotyy-with-error-bars-and-3-sets-of-data 2-D line plot with y-axes on both left and right side for two different number ranges for the y axis. I need error bars as well for the plot. There are 3 sets of data that are made and 2 of them are going to be on the same 1st axis and one of them is going on the 2nd axis. I have really never used the plotyy, let alone trying to make errorbars on the plotyy and doing 3 sets of data on the same plot.Here is some code that I have been playing with to try to make the the plot as of now:sliceNum = 10; figure ax = gca; for x = 1:sliceNum+1 s(x) = struct('field1',rand(1,5)*10,'field2',rand(1,5)*10+40,'field3',rand(1,5)*10); end needed = s(2:end); nums = reshape([needed.field2]',5,sliceNum); cal = [40 0.8 0.9];%need to find source AreaVal = nums(1,:).*cal(1); meanVal = nums(2,:).*cal(2); RMSVal = nums(3,:).*cal(3); numsStd = reshape([needed.field3]',5,sliceNum); AreaValStd = numsStd(1,:).*cal(1)*0.05; meanValStd = numsStd(2,:).*cal(2)*0.05; RMSValStd = numsStd(3,:).*cal(3)*0.05; errorbar(1:sliceNum,AreaVal,AreaValStd,'.-','Parent',ax); hold(ax,'on'); errorbar(1:sliceNum,meanVal,meanValStd,'.-g','Parent',ax); errorbar(1:sliceNum,RMSVal,RMSValStd,'.-r','Parent',ax); hold(ax,'off'); xLab='Slice Number'; xlabel(ax,xLab); ylabel(ax,'count ()'); % title(ax,opts.title); legend(ax,'Sum','Mean','RMS'); legend(ax,'boxoff'); When this code is run, random data is generated (similar to the real data) and then i
in Matlab Matlab Movie Subplot → Copyright © 2016, Yasser Khan. ↑
von GoogleAnmeldenAusgeblendete FelderNach Gruppen oder Nachrichten suchen