小编T. *_*ima的帖子

如何返回矩阵?

我正在尝试进行Cramer线性求解,我编写了一个替换矩阵列的函数,就像这样:

void replacecol(int c, int n, float mat_in[n][n], float vect_in[n],
        float mat_out[n][n])
{
    int i, j;

    for (i = 0; i < n; i++)
    {
        for (j = 0; j < n; j++)
        {
            if (j == c)
            {
                mat_out[i][j] = vect_in[j];
            }
            else
            {
                mat_out[i][j] = mat_in[i][j];
            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

但它目前是无效的,我希望它返回mat_out的值,当我调用这个函数时......我怎么能这样做?

c parameters matrix

0
推荐指数
1
解决办法
566
查看次数

标签 统计

c ×1

matrix ×1

parameters ×1