How to create continuous points and plot in quiver

2 ビュー (過去 30 日間)
Tina Hsiao
Tina Hsiao 2021 年 4 月 11 日
Hello, I would like to seek your help. I had created discrete points and plot vector field by using the quiver function. Now, I would like to create continuous points which are in the same range (0 to 300), and the result of vector field should be the same as discrete points.
my code as below,
clear all; close all; clc
% discrete points
v = 0:25:300;
[x,y] = meshgrid(v);
z = -cos(x).*(-x.^2 - y.^2)*1e-4;
[px,py] = gradient(z);
figure(1)
quiver(x,y,px,py)
hold off

回答 (0 件)

カテゴリ

Help Center および File ExchangeVector Fields についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by