From: michael caro on
On May 4, 7:03 pm, Walter Roberson <rober...(a)hushmail.com> wrote:
> michael caro wrote:
> > On May 4, 6:09 pm, Nathan <ngrec...(a)gmail.com> wrote:
> >> If so:
>
> >> for i = 1:na
> >>     Y(i,:)={1./sqrt(1+(t.*a(i)).^2)} %note the braces
> >> end
> > Thank you for picking up on the mistake but thats not exactly what I'm
> > looking for.
> > How can I change the loop so matlab doesnt try to convert it into a
> > double?
>
> Nathan already answered that. Go back and reexamine the line, and "note the
> braces". His solution already prevents matlab from trying to convert into a
> double.
>
> > i'd like to create an array with 5 rows and 101 columns. the 5 rows
> > correspond to each different 'a' variable being evaluated with all of
> > the 't' variables, so i can then create a plot saying plot(t,Y)
>
> If you want to be able to do it with a single plot() call like you show, then
> you *do* want the values converted to double -- plot can handle a numeric Y
> array with multiple rows, but it cannot handle cell arrays to represent the rows.

Walter, thank you as well.
First  |  Prev  | 
Pages: 1 2 3
Prev: rgb image processing
Next: neural networks