필터 지우기
필터 지우기

How to apply a function independently for a set of data?

조회 수: 2 (최근 30일)
Benson Gou
Benson Gou 2021년 6월 4일
댓글: Walter Roberson 2021년 6월 5일
Dear All,
I have a set of data {Ai, bi}, i = 1, ..., N. I want to apply a function which solves Ai(xi) = bi, a nonliear problem. {Ai, bi} is indepentent and has nothing to do with each other for all i. My question is how to apply the function to solve the group together, A = [A1 A2 ... AN], b = [b1, b2, ..., bN]. My goal is to speed up my computation.
The original process is that I repeatly run the function N times to solve Ai(xi)=bi, i = 1, ..., N, where xi is a single variable. Now I want to run the function at one time to solve all Ai(xi)=bi, i=1,...,N, together. My rough idea is to form a matrix A = [A1 A2 ... AN], b = [b1 b2 ... bN], and then run the fucntion one time to solve all xi, i = 1, ..., N. But I am wondering if there is a simpler way to solve all equations together.
Thanks a lot.
Benson
  댓글 수: 3
Benson Gou
Benson Gou 2021년 6월 5일
Dear dpb,
Thanks a lot for your reply. Please review my submission which was added more details about the my problem. Please let me know if it is clear or not.
Best regards,
Benson
Walter Roberson
Walter Roberson 2021년 6월 5일
Whether your approach would work or not would depend upon the computation involved. In some cases it might be quite efficient to do all of the matrices at the same time; in other cases it might be mathematically difficult to do all of them at the same time. Or it just might not be efficient to solve them all at the same time.
We would need to know more about the computation to advise further.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by