help-octave
[Top][All Lists]

## Re: problem plotting "N-d object"

 From: Sergei Steshenko Subject: Re: problem plotting "N-d object" Date: Tue, 21 Feb 2012 06:57:03 -0800 (PST)

```
--- On Tue, 2/21/12, Ben Abbott <address@hidden> wrote:

> Subject: Re: problem plotting "N-d object"
> Date: Tuesday, February 21, 2012, 5:29 AM
> On Feb 21, 2012, at 5:29 AM, CdeMills
> wrote:
>
> > bpabbott wrote
> >
> type operator ".+" and
> >> that "+" would behave in a strict/pedantic manner
> (as with multiplication
> >> and division).
> >>
> >> In any event, I do think there is a parallel to be
> drawn for N-d plotting.
> >
> > Ben,
> >
> > I had the same idea.
> >
> > I often run simulations, producing 2D arrays at each
> step, and collating
> > everything in a 3D array.
> >
> > Then I plot everything as:
> >
> > hold on; resu = [];
> > for inds = (Nsimu:-1:1)
> >  resu(inds, 1) = plot(somevar(:, :, inds));
> > endfor
> > hold off
> >
> > That is, the third dim is "peeled" slice by slice, and
> all 2D graphs are
> > concatenated together.  Similary, the result is a
> vector a graph handles.
> > Would this seems an acceptable way to "plot" a 3D array
> ?
> >
> > Regards
> >
> > Pascal
>
> For plotting that is a good solution.
>
> In my work, I work with a lot of frequency dependent
> systems, which we represent as matrices ... matrices with
> different elements for each frequency.
>
> For this purpose., we use the 3rd dimension to represent
> frequency. This allows us to peal off frequency and do the
> usual linear algebra.
>
> We'd also like to plot the elements of a matrix by something
> like ...
>
>     plot (f, A(1,1,:), f, A(1,2,:), f,
> A(2,1,:), f, A(2,2,:))
>
> Instead of that we have to squeeze() each frequency
> dependent matrix element first.
>
> There are ways to work around this. For example, we often
> permute, then plot, permute, and continue with the linear
> algebra. Other times we use squeeze().
>
> I'd prefer to just use the syntax above.
>
> Ben
>

"I'd prefer to just use the syntax above" - I think that was my original
request, wasn't it ?

Thanks,
Sergei.

```