Error while reading/writing variables from embedded matlab function..
Ältere Kommentare anzeigen
i am writing an embedded matlab function . the code is working fine when i enter the variables manually into the code but what i want to do is to import the variables from a .mat file
i have tried loading the file using blockproperties>>callback>>initfcn>>load("filtercoeff.mat') which contains the coefficient vector 'h'
a part of my code is----> %%%%%%%%%%%%%%%%% function y = fcn(u); eml.extrinsic('load'); load('FilterCoeff.mat'); h1=h; sum=0; for j=1:11; sum=sum+u(j)*h1(j); end y = sum; %%%%%%%%%%%%%%%%% but when i try to run the simulation is says" Undefined function or variable 'h'.
Function 'Embedded MATLAB Function' (#18.532.533), line 13, column 4: "h" Launch diagnostic report."
please tell me where i am going wrong..
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Whos finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!