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: Storing of values in an array
Replies: 7   Last Post: Jan 30, 2014 8:44 AM

Advanced Search

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

Posts: 14
Registered: 6/10/13
Re: Storing of values in an array
Posted: Jan 25, 2014 1:37 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


But that is displaying the final value of SF1 and SF2.
This is the code for SF1 where rad2 is a matrix and rows3 is the number of rows of matrix rad2.
for c=1:(rows3-1)
for d=2:rows3
if (d-c)==1
angle=rad2(c,3)-rad2(d,3);
Vc=rad2(c,2);
Vd=rad2(d,2);
R=rad2(c,6);
alpha=(R*cos(angle*pi/180))/(Vc*Vd);
beta=(R*sin(angle*pi/180))/(Vc*Vd);
Bus=rad2(c,1);
SFrad2=(alpha*rad2(c,4)-beta*rad2(c,5));
SF1=[rad2(c,1) SFrad2]
% VS3=
else
end
end
This is the code for SF2 where rad3 is a matrix and rows4 is the number of rows of matrix rad3.
for c=1:(rows4-1)
for d=2:rows4
if (d-c)==1
angle=rad3(c,3)-rad3(d,3);
Vc=rad3(c,2);
Vd=rad3(d,2);
R=rad3(c,6);
alpha=(R*cos(angle*pi/180))/(Vc*Vd);
beta=(R*sin(angle*pi/180))/(Vc*Vd);
Bus=rad3(c,1);
SFrad3=(alpha*rad3(c,4)-beta*rad3(c,5));
SF2=[rad3(c,1) SFrad3]
% VS4=
else
end
end
end

Now I need to store all the values of SF1 and SF2 (i.e values generated in each iteration) in another array/matrix OV. Now can you help me?
enddpb <none@non.net> wrote in message <lbttuv$ikt$1@speranza.aioe.org>...
> On 1/24/2014 8:25 AM, dpb wrote:
> ...
>

> > But, to answer the question
> >
> > OV=[SF1 SF2]; % SFx are row vectors
> >
> > or
> >
> > OV[SF1;SF2]; % they're column-oriented

>
> ERRATUM:
>
> Missing '=' sign, of course...
>
> OV=[SF1;SF2]; % they're column-oriented
>
>
> --




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.