C's typedef struct in Matlab?

C's typedef struct in Matlab?

Post by leequi » Tue, 15 Aug 2006 19:09:40


Is there any way to create "typedef" forms in Matlab?
I want to create arrays like these..
-----------------------------------------------
typedef int PType[1501];
typedef double MomArray[51][51];

typedef struct
{
double Cx; /*CentrX */
double Cy; /*CentrY */
double Md; /*MaxDist */
double Ld; /*LesDist */
double Ad; /*AvgDist */
double Rp; /*RealPerim */
double Ra; /*Rotangle */
double Asu; /*AreaSum */
int Np; /*PointNum */
PType Rx;
PType Ry;
}
Curve;

typedef Curve CType[10]; /* */


MomArray *OrigMom;
MomArray *FinMom;
PType *Px;
PType *Py;
CType *ECM;
CType *ICM;
-----------------------------------------------

Sorry for my poor knowledge but "*Px" stands for pointer?
Is there any way to reproduce it in Matlab?

Thanks in advance.
 
 
 

C's typedef struct in Matlab?

Post by leequi » Tue, 15 Aug 2006 20:07:09

Thanks i will try with cell arrays but what is closest to pointer use?
Thanks

 
 
 

C's typedef struct in Matlab?

Post by Rune Allno » Tue, 15 Aug 2006 23:38:21


I suppose cell arrays are what come closest?


It is probably possible, but it is not particularly easy or
convenient. For somebody who is used to program C,
matlab is not at all streamlined.

Rune
 
 
 

C's typedef struct in Matlab?

Post by Michael Wi » Wed, 16 Aug 2006 00:29:12


no pointers in matlab.

michael