"Andy " <myfakeemailaddress@gmail.com> wrote in message <i4eie9$b6m$1@fred.mathworks.com>...
> "Nathan Jensen" <swishidgenj@yahoo.com> wrote in message <i4ehup$amd$1@fred.mathworks.com>...
> > I'm trying to do something like this:
> >
> > A{1}={...}
> > A{2}={...}
> > A{3}={1 2 3 [] 5 6}
> > A{4}={...}
> >
> > B=[1 2 3 4 5 6]
> >
> > for i=1:4
> > plot(A{i},B)
> > end
> >
> > Any ideas?
> > Thanks,
> > Nate
>
> What exactly is going wrong? Are the graphs not what you want them to be? Are you getting an error message which you are for some reason not showing us? My best guess at your problem is that you're getting an error message because A{i} is a cell. Don't wrap the right hand sides of your assignments in curly braces. But that's just a guess.
I'm sorry if I didn't make myself clear, here is the code again:
A{1}={1 2 3 4 5 6}
A{2}={1 2 3 4 5 6}
A{3}={1 2 3 [] 5 6}
A{4}={1 2 3 4 5 6}
B=[1 2 3 4 5 6]
for i=1:4
figure
plot(A{i},B)
end
if you try to run this code, you will get the following error message:
??? Error using ==> plot
Conversion to double from cell is not possible.
The reason that I think that I need to use cells is because
A{3}(4) = []
and if I simply stated
A{3}=[1 2 3 [] 5 6]
or
A(3)={[1 2 3 [] 5 6]}
then
A{3}=[1 2 3 5 6]
which completely misses the empty cell []
do you understand what I am trying to say?
