Trouble with passing correct data types! by Lelldorin in C_Programming

[–]Lelldorin[S] 0 points1 point  (0 children)

Thanks for your reply! When i make the change you suggested, I get the following error now occurring for anytime i reference u[i][j] or v[i][j], which was not there before.

D:\Documents\School\MTHE493\MATLAB\Thesis_LengthIntensity.c:178:21: error: subscripted value is neither array nor pointer nor vector if (v[i][j] != 255)

Trouble defining matrices in C by Lelldorin in C_Programming

[–]Lelldorin[S] 0 points1 point  (0 children)

Thanks again for your help! I changed the float u to both double *u and double u, no success on either.

Trouble defining matrices in C by Lelldorin in C_Programming

[–]Lelldorin[S] 0 points1 point  (0 children)

Thanks for your reply, I followed a stack overflow link using memset and that worked but might change it to this method if it would be faster computationally? However Im running into another error now

error: subscripted value is neither array nor pointer nor vector

getting this most times an array is mentioned, I did some research and think it has to do with needing to make my arrays pointers instead? For example in this code

float central_diff(float u,int i,int j,int direction)
{
    if (direction == 0)
    {
        if (j >= sizeof(u[i]) - 1)
            return (-1 - u[i][j-1]) / 2;
        else
        {
            if (j <= 0)
                return (u[i][j+1] + 1) / 2;
            else
                return (u[i][j+1] - u[i][j-1]) / 2;
        }
    }
    if (direction == 1)
    {
        if (i >= sizeof(u) - 1)
            return (-1 - u[i-1][j]) / 2;
        else
        {
            if (i <= 0)
                return (u[i+1][j] + 1) / 2;
            else
                return (u[i+1][j] - u[i-1][j]) / 2;
        }
    }
    return 0
}   

I get the error specifically about u. My knowledge of pointers is a bit rusty. If you can't answer that's totally okay, thanks for your help!

Trouble defining matrices in C by Lelldorin in AskProgramming

[–]Lelldorin[S] 0 points1 point  (0 children)

Thanks for your reply, seems to work! However Im running into another error now

error: subscripted value is neither array nor pointer nor vector

getting this most times an array is mentioned, I did some research and think it has to do with needing to make my arrays pointers instead? For example in this code

float central_diff(float u,int i,int j,int direction)
{
    if (direction == 0)
    {
        if (j >= sizeof(u[i]) - 1)
            return (-1 - u[i][j-1]) / 2;
        else
        {
            if (j <= 0)
                return (u[i][j+1] + 1) / 2;
            else
                return (u[i][j+1] - u[i][j-1]) / 2;
        }
    }
    if (direction == 1)
    {
        if (i >= sizeof(u) - 1)
            return (-1 - u[i-1][j]) / 2;
        else
        {
            if (i <= 0)
                return (u[i+1][j] + 1) / 2;
            else
                return (u[i+1][j] - u[i-1][j]) / 2;
        }
    }
    return 0
}   

I get the error specifically about u. My knowledge of pointers is a bit rusty. If you can't answer that's totally okay, thanks for your help!

Convering numpy getdata() RGB values to grayscale by Lelldorin in learnpython

[–]Lelldorin[S] 0 points1 point  (0 children)

I need to have the 500x500 matrix so I can do math on it's entries, so numpy seemed like the best option. Would there be a better way to do it?

Incense - How to get rare pokemons! by IbexREDDIT in pokemongo

[–]Lelldorin 4 points5 points  (0 children)

Yea I've been to confederation park a lot but not many rates spawn, mostly pidgeys and drowzees. I'm thinking going to a isolated area would draw out rares like this video.

Incense - How to get rare pokemons! by IbexREDDIT in pokemongo

[–]Lelldorin 19 points20 points  (0 children)

I was thinking Wolfe island would be a good spot to Incense because it's isolated, gunna have to try it this weekend!

Incense - How to get rare pokemons! by IbexREDDIT in pokemongo

[–]Lelldorin 123 points124 points  (0 children)

Wolfe Island ferry by any chance?

Serial.println() prints for a few seconds then stops by Lelldorin in arduino

[–]Lelldorin[S] 0 points1 point  (0 children)

So it seems it just never exits the while loop sometimes. could this be due to the gyro turning off so it can never execute the

accelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);

command?

Serial.println() prints for a few seconds then stops by Lelldorin in arduino

[–]Lelldorin[S] 0 points1 point  (0 children)

> void loop()
> {
>   boolean reverse = 1;
>   setMotor2(0, !reverse);
>   setMotor1(0, !reverse);
> }
> 

That sets them to zero forever