Attempt to extract field 'iterations' from 'mxArray'
이전 댓글 표시
Hello! I need help. My problem is in Title. I use codegen for translate .m-code in mex.
[xopt,zmin,exitflag,output,lambda] = linprog(C1,A,B,[],[],LB1,[],[],options);
fprintf(1,Out1,xopt,zmin);
fprintf(1,'ExitFlag= %d\nIterats= %d\n',exitflag,output.iterations);
How can I solve this problem?
채택된 답변
추가 답변 (1개)
Joh Hag
2018년 10월 26일
0 개 추천
hi, is output a struct? the mxArray is just the bare data and does not have such a field. have you tried to put the value in a separate variable such num_iterations = output.iterations? and then use this one in the fprintf command. this could help codegen to sort things out.
댓글 수: 3
Grek Vardugin
2018년 10월 26일
Joh Hag
2018년 10월 26일
Did you try the trick with the temporary variable? where does the compilation actually fail? at the fprintf's or when you call linprog?
Grek Vardugin
2018년 10월 26일
카테고리
도움말 센터 및 File Exchange에서 Common Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!