When I run this function, it gives the error "Data 'u_pr' (#427) is inferred as a variable size matrix, while its specified type is something else.". What is the solution for this problem? I will be happy for helps.
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
E U
am 14 Aug. 2014
Bearbeitet: Walter Roberson
am 28 Jan. 2020
function [opt_st, u_pr, y_pr, cv_pr] = fcn( nu, ny, Np)
%#codegen
coder.extrinsic('mpc_ea');
opt_st = zeros(1); u_pr = zeros(nu,Np+1); y_pr = zeros(ny,Np+1); cv_pr =zeros(1);
[opt_st, u_pr, y_pr, cv_pr] = mpc_ea;
0 Kommentare
Akzeptierte Antwort
Ryan Livingston
am 18 Aug. 2014
The variable u_pr is being declared as:
u_pr = zeros(nu,Np+1);
which means that it is variable size since its dimensions depend upon the inputs nu, Np, which are not known until run time.
You need to mark the output signal u_pr as being variable size in the ports and data manager:
and provide upper bounds for it there.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Deployment, Integration, and Supported Hardware finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!