Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Problem using fzero in classed method
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello, I am trying to apply fzero() to a function defined as Methods (Access = private) in a classdef, without success, here attached the .m file.
The class myclass contains: - two public methods(oper and testZero) - two private methods (setb and valzero)
I have a problem with using testZero which applies fzero to valzero. I suppose I am declaring in a wrong way the fzero parameters.
Could you please advice?
Thanks a lot in advance Best regards, P
댓글 수: 0
답변 (1개)
Walter Roberson
2015년 11월 29일
av=fzero(@valzero,obj,2); is only going to pass one parameter to valzero, but you defined valzero as needing two parameters, obj and a. Perhaps you want
av = fzero(@(x) valzero(obj,x), 2);
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!