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: Plotting a line with variables from a matrix
Replies: 9   Last Post: Feb 18, 2013 1:50 PM

Advanced Search

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

Posts: 7,873
Registered: 6/7/07
Re: Plotting a line with variables from a matrix
Posted: Feb 18, 2013 1:50 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 2/18/2013 9:44 AM, dpb wrote:
...

> OK, for a straight-ahead solution try the following...
>
> V=[1:5];
> A=reshape([10:10:40],2,2)';
> a=zeros(size(A,1),size(A,2),length(V));
> for i=1:length(V)
> a(:,:,i)=inv(V(i).*A);
> end

...


> That will leave you w/ a result 3D array from which it selects the
> planes to plot one at a time...if your array sizes are really, really,
> really large you may have memory problems in which case you may need to
> write to file and postprocess them -- but then you may well have numeric
> problems anyways w/ inverse.


OBTW, one way to handle it if sizes are very large other than by keeping
all inverses simultaneously would be to add points to each plot/line
sequentially somewhat like if were doing an animation.

There are examples in enhanced graphics on animation that illustrate the
idea but basically you plot the first x,y points individually to start
the lines then augment the data vector w/ each additional set as you
compute the new inverse.

--





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.