Use a matlab function as a mathematical function for plotting, differentiation
정보
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
Hi all,
I have a function with the following signature err = errvarX(x,y) where x and y are scalars and err is the scalar output of my custom user-defined matlab function.
I wish to use it with surf but my function only takes scalars as inputs, i.e I can't do errvarX(1:10, 1:10) and have a 10x10 matrix output. I would also like to use it with diff or any other function to have its derivative, though it is a regular matlab function I can't treat it as anything else.
This might be a common problem but I've been searching and couldn't find any answer to this.
댓글 수: 0
답변 (1개)
Star Strider
2018년 10월 25일
0 개 추천
I have no idea what ‘errvarX’ is or does, much less how it works.
I am guessing here that Array vs. Matrix Operations (link), Vectorization (link), or the arrayfun (link) function could possibly lead you toward a solution. If you want a numerical derivative, I would use gradient rather than diff.
댓글 수: 0
이 질문은 마감되었습니다.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!