Variable q5 must be of size [1 2]. It is currently of size [1 1]. Check where the variable is assigned a value.

조회 수: 12 (최근 30일)
syms x y
f(x,y)=x-x*y^2+sqrt(y);
u=[2,9];
q5=dot(u/norm(u),jacobian(f(x,y),[x,y]));

답변 (1개)

Walter Roberson
Walter Roberson 2024년 3월 14일
syms x y
f(x,y)=x-x*y^2+sqrt(y);
u = sym([2,9]);
part1 = u/norm(u)
part1 = 
part2 = jacobian(f(x,y),[x,y])
part2 = 
q5 = dot(part1, part2)
q5 = 
You have the dot product of a 1 x 2 and a 1 x 2. The result is going to be 1 x 1. You should not expect anything different for that set of equations.
  댓글 수: 6
Torsten
Torsten 2024년 3월 14일
편집: Torsten 2024년 3월 14일
What is delta f(2,9) ? The gradient of f in (2,9) ?
syms x y
f=x-x*y^2+sqrt(y);
q5 = subs(jacobian(f),[x y],[2,9])
q5 = 

댓글을 달려면 로그인하십시오.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by