Hi everybody,
I want to do the following:

For each bar create Matrix A (3rows X 1 Column) and fill that matrix with the close of the current bar and the close of the two previous bars.
This way the bar of today (bar count N) will have a matrix with the close of bar n and the close of n1 and the Close of n2.
Bar of yesterday (Barcount n1) has the close Barcount n1, n2 y n3. 
Multiply each element of Matrix A by the current value of the RSI(5).
In order to do so
Step 2a) I create Matrix C (1 row1colum) where I store the Value of RSI(5) of the current bar
Stept 2b) I multiply MATRIX A @ MATRIX B
This way I will get a Matrix C which will have also 3 rows and 1 column and each element of the matrix C will be:
First element in row1= Close today RSI(5) today
Second element (Row2): Close yesterdayRSI(5)today
Third element (row 3); close two days agoRSI(5)today . 
Now I want to calculate the result of MATRIX C minus REF(MATRIX C,1).

Convert the MatrixA to a String and then from string to Number with the idea of applying AFL formulas to such list of number.
For instance if the list of number is List= (25,17,32,47,55)
To use the following formula diff=cRef(c,1); where c is the values within the list.
Below is the Code I Wrote.
//STEP 1
MATRIXA = Matrix( 3, 1, 0 );// Create a Matrix of 10 rows and 1 Column
MATRIXA = MxSetBlock( MATRIXA, 0, 2, 0, 0, Close );// I fill the matrix with the close array
MatrixAString=MxToString(MATRIXA);// I will display this variable in the exploration to see it it does what I want.
//STEP 2
MATRIXB = Matrix( 1, 1, 0 );// Create a Matrix of 1 rows and 1 Column
MATRIXB = MxSetBlock( MATRIXA, 0, 0, 0, 0, RSI(5));// I fill the matrix with the RSI(5) array. Also Tried with LastValue(RSI(5)
MatrixBString=MxToString(MATRIXB);// I will display this variable in the exploration to see it it does what I want.
// step 2b
MATRIXC=MATRIXA * LastValue(RSI(5) );// Should not be the same that line 24 below??
MatrixCString=MxToString(MATRIXC);// I will display this variable in the exploration to see it it does what I want.
//Or I understand that should be able to be done this way too
//MATRIXC=MATRIXA @ MAtrixB;// Amibroker does not let me because It says that the number of columns in matrixA should be equal to number of rows Matrix B
// wich I do not understand because MAtrix B is a MAtrix of 1*1.
//Step 3
//I want to Calculate the result of Matrix C Minus Ref (MAtrixC,1);
// Step 4 Convert MatrixA to list of number with the intend to apply AFL formulas over that list of numbers.
STringlistaA=StrToNum(MatrixAString);// I will dispay in the exploration to see how it works.
Filter=1;
AddColumn( C, " c ", 1.2);
AddColumn(RSI(5),"rsi5",1.2);
AddTextColumn(MatrixAString,"MatrixAString",1.2);
AddTextColumn(MatrixbString,"MatrixBString",1.2);
AddTextColumn(MatrixCString,"MatrixcString",1.2);
AddColumn(STringlistaA,"STringlistaA",1.2);
And Also a picture of the Exploration Output
Now let’s review step by step comparing what I get vs what I expected
Step1)
I see that the elements of the matrix are the first 3 values of the Array Close and are kept the same in the matrix of every bar.
Step2a)
I do not understand why shows a Matrix of three rows when I actually define the matrix B as 1X1. I do not understand either why it does not include the RSI Value of the bar.
I also tried with last Value ( RSI(5); but it did not work either. Next What I expected to get.
Step2b)
I do not know what is calculating. Anyway, the elements of the matrix do not change as I expected.
Below what I expected to get:
Step 3) No idea how to do it. I do not know if I can use Ref to substract on matrix from the other.
Step4)
I do not know why the formula StrToNum
does not work, it could be because the string that comes out from the matrix is a wolfram type. But then, how I convert it to a list of numbers and being able to apply formulas over such list of numbers.
I know that you can access the elements of the array one by one the following way:
To access matrix elements, use:
my_var_name[ row ][ col ];
where
row is a row index (0... number of rows1)
and
col is a column index (0... number of columns1)
The issue is that if the Matrix have a few elements like in my example it is easy but If I have 90 elements seems very cumbersome.
I read the manual for matrix and performed searches but I do not see how to implement it.
I would appreciate any help. Thanks a lot in advance.