1

For example if I have:

Matriz = {{a, b}, {c, d}}
Matriz2[a_, b_, c_, d_] := Matriz;

when I run Matrix2 [1,2,3,4], the matrix is not evaluated. I would not like to use /.{a->..} because the parameter a and b are function of other variables.

Thanks

F.Mark
  • 599
  • 2
  • 8
  • 3
    try Matrix2[a_, b_, c_, d_] := Evaluate@Matriz? – kglr Aug 19 '19 at 18:03
  • 4
    Mandatory reading: https://mathematica.stackexchange.com/questions/8829/what-is-the-difference-between-set-and-setdelayed – Szabolcs Aug 19 '19 at 18:18
  • when i put the followings, the mathematica dont change the a value of matriz. f[a_] := NIntegrate[x, {x, 1, a}]; g[a_] := NIntegrate[Sin[x], {x, 1, a}]; matriz = {{a + ff, a - gg}}; Matriz22[a_] := Hold[Evaluate@(matriz /. {ff -> f[a], gg -> g[a]})] ReleaseHold[Matriz22[2]] – F.Mark Aug 19 '19 at 19:40

0 Answers0