Gamestudio Links
Zorro Links
Newest Posts
No connection to MT4
by JeyKey II. 10/29/26 09:34
Zorro plugin for Hyperliquid.xyz
by opm. 10/28/26 13:50
Icon "OP"
by JeyKey II. 10/27/26 07:03
ZorroGPT
by TipmyPip. 10/26/26 08:09
Chat Room for Zorro Programmers
by Haitao_Ren. 10/25/26 03:14
Trading Journey
by Haitao_Ren. 10/25/26 03:14
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
4 registered members (JeyKey II, TipmyPip, AndrewAMD, 1 invisible), 15,604 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Haitao_Ren, JimSimons, julienp, julienper, KelleyAbbey
19247 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Illegal Indirection in Matrix #488517
01/05/25 15:07
01/05/25 15:07
Joined: Apr 2023
Posts: 62
V
vicknick Offline OP
Junior Member
vicknick  Offline OP
Junior Member
V

Joined: Apr 2023
Posts: 62
I tried to place m + 22 for each matrix element. The matrix has N rows and one column.

Code
#define N  31
var m;
mat TrackingErrorMatrix = matrix(N,1);
for(m = 0; m < N; m++)
{
    me(TrackingErrorMatrix, m, 0) = m + 22;
}


But I got the following error code:
Code
Strategy compiling.........
Error in 'line 138: 
illegal indirection
<  me(TrackingErrorMatrix, m, 0) = m + 22;
 >.


I try to search the manual about this error but I am not able to find any. In fact, the manual also assign to each element by using the me() function.

In manual:
Code
for(i=0; i < A->rows; i++)
    for(j=0; j < A->cols; j++)
      me(A,i,j) = i+j;


Last edited by vicknick; 01/05/25 15:10.
Re: Illegal Indirection in Matrix [Re: vicknick] #488518
01/05/25 17:32
01/05/25 17:32
Joined: Feb 2017
Posts: 1,837
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,837
Chicago
Var is a double. Change var m to int m. me() is a macro that accesses elements of a matrix, so int is necessary.

Re: Illegal Indirection in Matrix [Re: AndrewAMD] #488520
01/06/25 14:37
01/06/25 14:37
Joined: Apr 2023
Posts: 62
V
vicknick Offline OP
Junior Member
vicknick  Offline OP
Junior Member
V

Joined: Apr 2023
Posts: 62
Thanks for your reply!

I am wondering if the elements in the matrix can be stored as var? I tried to store var in the matrix, but when I print them out, they are all integers.

Re: Illegal Indirection in Matrix [Re: vicknick] #488521
01/06/25 17:05
01/06/25 17:05
Joined: Feb 2017
Posts: 1,837
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,837
Chicago
Stored as a var? Yes. But your call is trying to access from an array using a var/double (a floating point number), which is nonsense.

If you supply an int, it will be stored as a var anyways.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1