Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Looped inset plot
Replies: 9   Last Post: Jan 18, 2013 5:23 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
dpb

Posts: 8,217
Registered: 6/7/07
Re: Looped inset plot
Posted: Jan 18, 2013 5:23 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 1/18/2013 2:55 PM, dpb wrote:
...

> Play around w/ the following revamping of your example and see the
> changes I've made--...


Well, that obviously would be easier if I hadn't forgotten to ^-V... :)

close 1
x = chi2pdf(sort(abs(randn(1,100))),2);
y = x.*abs(randn(size(x)));

figure
h1 = axes;
h2 = axes('pos',[.2 .5 .1 .4]);
set(h2,'fontsize',8)
while true
axes(h1)
plot(x,y,'*')
lsline
title(['R^2 = ',num2str(corr(x',y')^2,4)])
axes(h2)
boxplot(y)

pause(1)
m = mean(y);
outlier = quantile(y,.75) + 1.5*iqr(y);
if any(y>=outlier)
[~,ix]=max(y);
x(ix)=[];
y(ix)=[];
else
break
end
end

...

Your earlier test code (very slightly modified as well) pasted below...

z = find(y >= outlier);
if ~isempty(z)
[~ ind] = sort(y,'descend');
y(ind(1)) = [];
x(ind(1)) = [];
else
break
end

--




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.