Error using solve command of symbolic toolbox
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Victor
el 5 de Abr. de 2014
Comentada: Victor
el 8 de Abr. de 2014
I wrote a code to get a solution for the DSGE model I am working on but the S function was empty at first (when I trying to get the solution using sectors by sector) then later I had this error (when I wrote the whole equation at a go): Error using sym>checkindex (line 2429) Index must be a positive integer or logical.
Error in sym>privformatscalar (line 2376) checkindex(x);
Error in sym>privformat (line 2360) s = privformatscalar(x);
Error in sym/subsref (line 1578) [inds{k},refs{k}] = privformat(inds{k});
Please I need a genuine help. Thank you :)
0 comentarios
Respuesta aceptada
Walter Roberson
el 5 de Abr. de 2014
Your expression includes k(-1) and ppb(-1) which are attempts to access arrays at index negative one.
6 comentarios
Walter Roberson
el 6 de Abr. de 2014
Editada: Walter Roberson
el 7 de Abr. de 2014
Sometimes there just isn't a closed form solution to a problem.
When you use solve() in the form you are using, each of your numeric constants is being converted from (inherently in-exact) floating point into (exact) rational values, and then an exact solution is sought. If you want to approximate, get a numeric solution, then you need to set it up slightly differently.
Are you aware that one of your left hand sides is s-s (which would of course be 0) ?
You are attempting to solve 49 equations in 62 variables, unless some of those variables (other than coef) are being loaded with the "load" statement. You will almost never find a solution when you have more variables than equations.
Más respuestas (0)
Ver también
Categorías
Más información sobre Calculus en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!