Problem with Array initialization each time (Matlab embedded function)
Show older comments
Hello, I'm quite new to matlab, and try to code in c-style. My problem is, I have a embedded matlab function, which reads the error values and the index from input and update in the array. This looks like so..
function u1 = EvaluatePattern(HopSeq,Dis,Erri,ErrV,En)
ErrpatternArray= [1,1,1,1,1,1,1,1,1,1,1];
ErrpatternArray(Erri) =ErrV;
the Erri and ErrV will be the random values and will be updated each time this embedded block run. I just tried debugging, and found that each time "ErrpatternArray" is initiated and the whatever the update i had made in the previous is not stored. I just want to declara and initiate this array only at the very begining and keep updating the values. I couldn't find any solution. Can anybody please help me out.!!! - regards Aravind
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!