Skip to content
Advertisement

How to plot a function with a vector and matrix in python?

But function f is a problem because I don’t know how to combine the mesh with the matrix, is there a smart way to solve this problem?

Advertisement

Answer

It looks like your code for g is very close to the one for f. You could just define your M matrix and include it in the matrix multiplication. See code below for more details:

JavaScript

The output gives: Diagonal values: [8.62030848 2.68367524] And the plot: enter image description here

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement