Firstly I am very grateful that you took the time to read this!
I have two sets of relevant information.
First of all, this recurrence formula:
$x_{n+1} = x_n - y_n \tan(\phi_{n+1})$ and $y_{n+1} = y_n _ x_n \tan(\phi_{n_1})$
With $x_0 = 1, y_0 = 0$
Now the $\phi_n$'s I have values for, which I found using a loop.
I am unsure how to incorporate these values of $\phi_n$s into an loop which computes the above recurrence formula.
Secondly, to calculate my $phi_n$'s, which I store in a 1x6 matrix B I Use:
format long
T = 1.047197551196598
for i= 1:6 % works fine with 6 iterations
x = atan(10^(-i+1))
n = floor(T/x)
y(i) = n
m(i) = x
T = T - n*x
end
% let A be a 1x8 matrix of the values y(i) from i=1 to i=8
A = [ 1, 2, 6, 2, 4, 6]
% let B be a 1x8 matrix of the values of m(i) for i=1 to i=8
B = [0.785398163397448, 0.099668652491162, 0.009999666686665, 0.000999999666667, 0.000099999999667, 0.000010000000000]
% check to see if our found integers multiplied respective basis work
dot(A,B)
So The matrix B has the values of $\phi$ eg: $phi_1 = 0.785398163397448$ $phi_2 = 0.099668652491162$ and so on.
Q1. I want to use the assigned values in the matrix $B$ for each step in my recurrence formula above.Is there a way to do this?
Q2. The matrix B I have, I copied and pasted the results manually from what m(i) gave me. Is there a way for m(i) to be output as a vector instead of a string of numbers (I hope I used the word "string" correctly)?
Aucun commentaire:
Enregistrer un commentaire