Why does the programm do not run the script and continues to get unexpected expression?
古いコメントを表示
x = linspace (0,10);
x = 0:0.5:10;
y = 2-10*x.*exp(-.8*x);
plot (x, y); grid on;
x = 0
y = 2-10*x.*exp(-.8*x)
f = @(x) 2-10*x.*exp(-.8*x)
[xr fx] = fzero(f, 0)
[xrr fx] = fzero(f, 4)
[xmin, fmin]=fminbnd(f,1,2)
%PART 2
line12>>subplot(1,2,2) surf(xgrid,ygrid,func(xgrid,ygrid))
[xgrid, ygrid]=meshgrid(-2:0.1:0,0:0.1:3);
func= @(x,y) 2+x-y+2*x.^2+2*x.*y+y.^2
subplot(1,2,1); contour(xgrid,ygrid,func(xgrid,ygrid))
subplot(1,2,2); surf(xgrid, ygrid, func(xgrid,ygrid))
f = @(x) 2+x(1)-x(2)+2*x(1)^2+2*x(1)*x(2)+x(2)^2
[x, fval]=fminsearch(f,[-.5, 0.5])
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!