Calculations with functions in cells

조회 수: 1 (최근 30일)
Spyros Polychronopoulos
Spyros Polychronopoulos 2017년 11월 9일
댓글: Spyros Polychronopoulos 2018년 5월 5일
Hello I have the matrix d and I would like to calculate the minimum value in the first cell d{1}. But I have a mistake somewhere:
A1=rand(64,1);
A2=rand(2,2);
for k = 1:1:2
d{k}=@(z) (((A1(:,1)-A2(k,1)).^2)+((z-A2(k,2)).^2));
end
z0=[0,0];
fminsearch(d{1},z0)
  댓글 수: 8
Juliana Tavora
Juliana Tavora 2018년 5월 5일
Hi Spyros Polychronopoulos, did you find a solution for your question? I am having a similar problem.
I have 2 arrays (200x200 each) and trying to make a sum of functions.
Spyros Polychronopoulos
Spyros Polychronopoulos 2018년 5월 5일
Hi Juliana, I don't understand your issue. could you send here an example code?

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

답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by