"Error using quiver"???

The error I get from my code is as follows:
Error using quiver (line 44)
DOUBLE cannot convert the input expression into a double array.
If the input expression contains a symbolic variable, use VPA.
CODE:
clear all;
syms y t;
f = (2*y - t)/ (2*t - y);
c = (abs(t - y))/ (abs((t + y)^3));
l = sqrt(f.^2 + 1);
[t, y] = meshgrid(-5:0.2:5, -5:0.2:5);
quiver(t, y, 1./l, f./l, 0.5), axis equal tight
xlabel 't', ylabel 'y'
END CODE
Please tell me what' I'm doing wrong!

回答 (1 件)

Alka Nair
Alka Nair 2015 年 2 月 25 日

0 投票

When the input argument to DOUBLE function is a symbolic expression, MATLAB will output the error message you received.
In this particular case, the arguments to 'quiver' '1./l' and 'f./l' are symbolic expressions. To workaround this issue, Use 'EVAL' to evaluate the symbolic expression.

カテゴリ

ヘルプ センター および File ExchangeProgramming についてさらに検索

質問済み:

2015 年 2 月 24 日

回答済み:

2015 年 2 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by