how to plot surface for this problem.
1 回表示 (過去 30 日間)
古いコメントを表示
a=[ 0.042 0.056 0.082]
b=[45 50 56]
c=[10 15 35]
Xmin=[ 10 45 60]
Xmax=[ 100 200 150]
F=a*X^2 +b*X+c
how to plot surface( visualize) for "F" function versus X for different values of X over different iterations
0 件のコメント
回答 (2 件)
KSSV
2018 年 5 月 14 日
a=[ 0.042 0.056 0.082] ;
b=[45 50 56] ;
c=[10 15 35] ;
Xmin=[ 10 45 60] ;
Xmax=[ 100 200 150] ;
n = length(a) ;
N = 100 ;
F=@(a,b,c,X) a*X.^2 +b*X+c ;
figure
hold on
for i = 1:n
x = linspace(Xmin(i),Xmax(i),N) ;
[X,Y] = meshgrid(x,x) ;
Fi = F(a(i),b(i),c(i),X) ;
surf(X,Y,Fi) ;
end
Aakash Deep
2018 年 5 月 14 日
I am assuming that your matrix X has a dimension nx3 where n can be your iterations. After executing your function command F=a*X^2 +b*X+c this will produce F with the same dimension as X. Now you can plot it using the surface plot command surf(F). I hope this will help.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Surface and Mesh Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!