How fplot legend works with four subplots of legendre functions?

3 ビュー (過去 30 日間)
Jaime Vera
Jaime Vera 2017 年 9 月 30 日
コメント済み: Walter Roberson 2017 年 10 月 1 日
Hi, I have this code:
clear all
clc
syms x
f1(x)=legendreP(1,x);
f2(x)=legendreP(2,x);
f3(x)=legendreP(3,x);
f4(x)=legendreP(4,x);
subplot(2,2,1), fplot(f1,[-1 1]), title('Polinomio de grado 1')
grid on
xlabel('x')
ylabel('f(x)')
subplot(2,2,2), fplot(f2,[-1 1]), title('Polinomio de grado 2')
grid on
xlabel('x')
ylabel('f(x)')
subplot(2,2,3), fplot(f3,[-1 1]), title('Polinomio de grado 3')
grid on
xlabel('x')
ylabel('f(x)')
subplot(2,2,4), fplot(f4,[-1 1]), title('Polinomio de grado 4')
grid on
xlabel('x')
ylabel('f(x)')
I want to understand how it works the legend in this case. I cannot figure out how it is.
The idea here is plotting 4 differents legendre functions with different titles and legends in each subplot.
Actually, each first time that I run this code, Matlab show me this errors:
Warning: Error updating FunctionLine.
Second input must be a scalar or vector of unique symbolic variables.
Warning: Error updating FunctionLine.
Second input must be a scalar or vector of unique symbolic variables.
Warning: Error updating FunctionLine.
Second input must be a scalar or vector of unique symbolic variables.
Warning: Error updating FunctionLine.
Second input must be a scalar or vector of unique symbolic variables.
And I can't too figure out why this is happening, because the second time I run it, I get the graphic.
Could you, please, help me?
Thank you
Have a nice day.
  1 件のコメント
Walter Roberson
Walter Roberson 2017 年 10 月 1 日
In R2017b I do not observe any warning.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by