From: Rui Guerra on
Thanks Jens and Steve for solving the problem. I stumbled in the same question and found the answer here. In order to ease the task for the next "seeker", I just would like to add a final summary.

In brief:

if you want to have errorbar(x,y,e1) on the left axis and errorbar(x,z,e2) on the right axis, just define the function

function f=input1(x,y,e)
f=errorbar(x,y,e);
end

and then issue the command

plotyy(x,y,x,z,@(x,y)input1(x,y,e1),@(x,z)input1(x,z,e2)).

Thanks again,

Rui
From: Rui Guerra on
Thanks Jens and Steve for solving the problem. I stumbled in the same question and found the answer here. In order to ease the task for the next "seeker", I just would like to add a final summary.

In brief:

if you want to have errorbar(x,y,e1) on the left axis and errorbar(x,z,e2) on the right axis, just define the function

function f=input1(x,y,e)
f=errorbar(x,y,e);
end

and then issue the command

plotyy(x,y,x,z,@(x,y)input1(x,y,e1),@(x,z)input1(x,z,e2)).

Thanks again,

Rui
From: us on
"Rui Guerra" <rguerra(a)ualg.pt> wrote in message <hv2qao$cn0$1(a)fred.mathworks.com>...
> Thanks Jens and Steve for solving the problem. I stumbled in the same question and found the answer here. In order to ease the task for the next "seeker", I just would like to add a final summary.
>
> In brief:
>
> if you want to have errorbar(x,y,e1) on the left axis and errorbar(x,z,e2) on the right axis, just define the function
>
> function f=input1(x,y,e)
> f=errorbar(x,y,e);
> end
>
> and then issue the command
>
> plotyy(x,y,x,z,@(x,y)input1(x,y,e1),@(x,z)input1(x,z,e2)).
>
> Thanks again,
>
> Rui

one of the (simpler) solutions

x=1:10;
y1=rand(size(x));
y2=2+2*rand(size(x));
e1=.1*y1;
e2=.2*y2;
% now, just use ERRORBAR...
plotyy(x,y1,x,y2,@(x,y) errorbar(x,y,e1),@(x,y) errorbar(x,y,e2));

us
From: Rui Guerra on
Of course! The function is redundant. Thanks, us!