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,881
Registered: 6/7/07
Re: Plotting a line with variables from a matrix
Posted: Feb 18, 2013 10:44 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 2/17/2013 5:16 PM, Vilius wrote:
> three example matrixes:
> V1=1
> A=[10*1 20*1 ; 30*1 40*1]
> a=inv(A)=[ -0.2000 0.1000; 0.1500 -0.0500]
>
>
> V2=2
> A=[10*2 20*2 ; 30*2 40*2]
> a=inv(A)= [ -0.1000 0.0500 ; 0.0750 -0.0250]
>
> V3=3
> A=[10*3 20*3 ; 30*3 40*3]
> a=inv(A)= [ -0.0667 0.0333; 0.0500 -0.0167]
>
> and so on with other Vs
>
> so on the graph (V;a11) : first point (1; -0.20) second point (2; -0.1)
> third point (3;-0.0667) and so on
>
> sorry for bad explanation and bad english, my question might be misleading
> again, thanks guys for your effort, thanks for answering.
> If I can figure it out how to do this i can write a proper report,
> otherwise it takes too much time to calculate everything seperately.


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
for i=1:size(a,2)
for j=1:size(a,1)
plot([1:5],squeeze(a(i,j,:)))
pause(1)
end
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.

--



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.