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

조회 수: 1 (최근 30일)
Hariprasad
Hariprasad 2014년 12월 1일
편집: Hariprasad 2014년 12월 1일
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;
}
if(index==1)
{
outliers = mxCalloc(100,mxREAL);
zerodata = mxCalloc(100,mxREAL);
inserting temporary data into outliers and zerodata;
}
else
{
}
}
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개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by