I have a function, RuKu4, which returns a struct file with three subvalues. The function is called like:
RuKu4([x1, x2], u) and returns
value: [2x1 double] sensX: [2x2 double] sensU: [2x1 double]
I would now like to call the function and just recieve the value parameter directly from the function. Something like RuKu4.value([x1, x2], u)

 채택된 답변

Adam
Adam 2014년 12월 3일

0 개 추천

Change the function and instead of returning the structure pull the field you want out of the structure within your function and return that instead.

댓글 수: 1

Image Analyst
Image Analyst 2014년 12월 3일
Philip's "Answer" moved here:
That would be a solution, but the problem is that I don't know how to do that since the function is created with ACADO toolkit, and I need the other subparameters for other parts of the code.

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

추가 답변 (1개)

Philip
Philip 2014년 12월 3일

1 개 추천

Just solved the problem with
f = getfield(RuKu4([x1 x2],u),'value')

카테고리

도움말 센터File Exchange에서 Structures에 대해 자세히 알아보기

질문:

2014년 12월 3일

댓글:

2014년 12월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by