What is this "struct with fields", and how do I get a numerical output rather than this?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello, I wrote this code which should determine the stationary points of a 2-variable function, it can be found below. The problem is that I get as output "struct with fields" even though I want as output the point of x and y when the gradient = 0. Is there a way to just get as output something like: x = ... ; y = ... ?
function [StatPoint] = StatPoint(f)
syms x y;
Gradient = [diff(f,x); diff(f,y)];
StatPoint = solve(Gradient == 0, x, y);
display(StatPoint);
end
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Numbers and Precision에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!