MATLAB Answers

How to re allocate memory in the same array using mxRealloc?

조회 수: 1(최근 30일)
Hariprasad 1 Dec 2014
편집: Hariprasad 1 Dec 2014
I'm trying to do some calculations in my code wherein I want to append data in respective double arrays after each iteration. For Ex.
double *outliers, *zerodata;
int index,i,j;
for(j = 0; j< index; j++)
for(i=0; i<100; i++)
doing calculations and saving in temporary arrays;
outliers = mxCalloc(100,mxREAL);
zerodata = mxCalloc(100,mxREAL);
inserting temporary data into outliers and zerodata;
Can I do something like this in the else part
outliers = mxRealloc(outliers,(outliers+100) * sizeof(*outliers));
I would want to keep appending data in outliers and zerodata array.

  댓글 수: 0

로그인 to comment.


이 질문에 답변하려면 로그인을(를) 수행하십시오.

Translated by