help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

error in function passing a matrix as argument


From: Guido Giuntoli
Subject: error in function passing a matrix as argument
Date: Wed, 28 Feb 2018 12:15:44 +0100

why this do not work ? :

main.m
...
[du, tol, its] = solver(jac, res, du, min_tol, max_its);
...

solver.m
function [du, tol, its] = solver(A, b, du, min_tol, max_its);
      du = -A\b; tol = 0.0 ; its = 0;
endfunction

gives:
error: sparse matrix type invalid as index value
error: run_lin.m: subscript indices must be either positive integers less than 2^31 or logicals
error: called from: main.c

if I put
du = -jac\res; tol = 0.0 ; its = 0;

It works ! why ? Thank you, Guido.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]