How to save all the results from the loop into a vector

Hello all,
so what I have is this:
tita = [-90 : 10 : 90] ;
Ftita0 = ( sin( ((k0 * lnov) / 2) * ((c / Vio0) - cos(tita)) ) ) / ( ((k0 * lnov) / 2) * ((c / Vio0) - cos(tita)) ) ;
What I need to do right now is, make it solve all Ftita0 with the tita above from -90 to +90 and plot them on a log graph. X to be tita and Y to be Ftita0. I tried with a for cycle, it solves the expression, but it just replaces Ftita0's result every time it goes through and I can't think of a way to save it to a variable which can be a vector.
Any ideas? Thank you for looking into this :)

Antworten (1)

ANKUR KUMAR
ANKUR KUMAR am 3 Jan. 2018
For saving the results in vector form after completing every loop, then just use A(i,:)
example:
A=randi(25,10,20);
for i=1:20
AA(i,:)=A(:,i)+randi(2,1,1);
end

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 3 Jan. 2018

Beantwortet:

am 3 Jan. 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by