필터 지우기
필터 지우기

Passing one variable out of a matrix

조회 수: 3 (최근 30일)
Will
Will 2012년 2월 16일
편집: Matt J 2013년 10월 15일
Hi
I have code that calls a function and passes a matrix to it. In the called function, calculations are performed based on only one value at a time from that matrix. How can this be done? At the moment the calculations are using the complete matrix?
thanks
  댓글 수: 4
Sean de Wolski
Sean de Wolski 2012년 2월 16일
You have to define c, ceq in ineqcon1().
Walter Roberson
Walter Roberson 2012년 2월 16일
Duplicate is at http://www.mathworks.com/matlabcentral/answers/29259-i-m-missing-something

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

답변 (1개)

Walter Roberson
Walter Roberson 2012년 2월 16일
The code in your previous question on this topic was not using the entire dx1 matrix to calculate with. You must have made an error in your interpretation of the behavior of the function.
  댓글 수: 12
Walter Roberson
Walter Roberson 2012년 2월 16일
[...], ineqcon1(@(a) deal(dx1(a),[])) )
Will
Will 2012년 2월 17일
Thanks very much for the reply. I am getting an error saying the number of outputs should match the number of inputs.

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

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by