How to get a contour plot from the combination of "for loop" and "matrix operation"?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
How to get a contour plot of say z = matrix_a * matrix_b?
Here matrix_a = f(x,y), matrix_b = f(x,y) and f(x,y) may be a complex function.
Possible approach may look like this:
Loop1: x = variable
Loop2: y = variable
matrix_a = f(x,y)
matrix_b = f(x,y)
Result: z = matrix_a * matrix_b
contourf(x, y, real(z))
or
contourf(x, y, imag(z))
0 comentarios
Respuestas (1)
madhan ravi
el 28 de Sept. de 2020
[X, Y] = meshgrid(x, y);
Z = X .* Y;
contourf(X, Y, Z)
2 comentarios
Ver también
Categorías
Más información sobre Loops and Conditional Statements 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!