How to simulate and draw electric fields in Matlab with contourf?

后端 未结 2 1449
感情败类
感情败类 2021-01-24 11:53

I\'d like to know how to draw a graph with 2 electric charges Q and -Q and their total E, for a specific point (eg (4,5)), with contour f.. My M-file actually scans the area (fr

2条回答
  •  不思量自难忘°
    2021-01-24 12:39

    You need to give some more information in your question: What is the problem you are having? What have you tried?

    However, assuming that z(i,j) is your electric field calculated on a 2d grid, just call contourf after your for loops as

    contourf(z)
    

提交回复
热议问题