berechnen sie in matlab x durch die multiplikation von f und den diagonalelementen von d. in matlab

Assuming that x, f, and d are matrices:

main.m
x = f * diag(d);
17 chars
2 lines

Explanation:

  • diag(d) returns a square matrix with the elements of d on the diagonal and zeros elsewhere.
  • Multiplying f and diag(d) will result in an element-wise multiplication of each column of f with the corresponding element of d. The resulting columns are then concatenated to form the matrix x.

related categories

gistlibby LogSnag