필터 지우기
필터 지우기

Quiver plot details and error

조회 수: 12 (최근 30일)
Cassandra Meyer
Cassandra Meyer 2022년 6월 8일
답변: Ayush 2023년 8월 30일
I've been handed a template code to make a quiver plot with little explanation, so I'm trying to learn more about quiver. First, it is giving me errors I don't know how to fix. Specifically, "input arguments must be numeric or objects which can be converted to double" starting with tmin. I was handed it the second way with function in it, but I get the same error (as well as syntax for the parentheses).
syms t y
f = @(t,y) t - y^2;
quiver(f, 0, 5, -3, 10, 'b')
syms t y
f = @(t,y) t-y.^2;
function quiver244(f, 0, 5;-3, 10, 'b')
For quiver plots in general: if I am asked to see how the graph changed when you start at different points, where can I input that? I am asked to prove my output using sampleplots, where I know I can put in a t0 and y0, but I have to do it with quiver first.
Any input would be appreciated.

답변 (1개)

Ayush
Ayush 2023년 8월 30일
Hi Cassandra,
I understand that you are facing difficulty in working with the “quiver” function used for plotting in MATLAB.
Regarding the specific error you pointed out i.e. “input arguments must be numeric or objects which can be converted to double", this is caused by the symbolic variables:
sysm t y
This is incompatible with the “quiver” function. It only accepts numeric values or similar objects as mentioned in the error message as well. Refer to the below documentation to know more about the “quiver” function:
Your second question can be catered by changing the initial conditions (“t0” and “y0”) in the definition of your function “f(t,y)”, in order to visualise the change from different starting points. Furthering this purpose, you can also consider different methods of plotting which are more suited for solution trajectories. Refer to the below documentation to know more about the plotting method in MATLAB:
Hope it helps,
Regards,
Ayush Misra

카테고리

Help CenterFile Exchange에서 Vector Fields에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by