People Education Research Industrial Agenda  
 
Current Research Archive Publications PhD theses Software      

 
Orttool is primarily written for PC-platforms. It includes 2 mex files,
selload.mex and incsave.mex

If the tool is to be run on other platforms, you have to create 
mex files for that platform, using the c-files
selload.c and incsave.c

They are included in this file


+++++ Collection of C-source code for SELLOAD and INCSAVE,
+++++ including help (.m) files

+++++ here starts selload.c ++++
/*

  SELLOAD.C	

  The calling syntax is:

			[A,B,..]=SELLOAD(file,var1,var2,...)

*/
#include 
#include 
#include "mat.h"
#include "mex.h"


#ifdef __STDC__
void mexFunction(
	int		nlhs,
	Matrix	*plhs[],
	int		nrhs,
	Matrix	*prhs[]
	)
#else
mexFunction(nlhs, plhs, nrhs, prhs)
int nlhs, nrhs;
Matrix *plhs[], *prhs[];
#endif
{
	MATFile *fp;
	char *file,*file2,*name;
	Matrix *pr1,*pll[1],*prr[1];
	unsigned int LEN,i,j,nstatus;
	double *status;
 
	/* Check for proper number of arguments */

	if (nrhs < 2) 
	{
		mexErrMsgTxt("SELLOAD requires at least two input arguments.");
	} 
	if (!(nlhs==nrhs)) 
	{
		mexErrMsgTxt("Incorrect number of output arguments.");
	}



	for (i=0;i
#include 
#include "mat.h"
#include "mex.h"


#ifdef __STDC__
void mexFunction(
	int		nlhs,
	Matrix	*plhs[],
	int		nrhs,
	Matrix	*prhs[]
	)
#else
mexFunction(nlhs, plhs, nrhs, prhs)
int nlhs, nrhs;
Matrix *plhs[], *prhs[];
#endif
{
	MATFile *fp;
	char *file,*name,*str;
	Matrix *mat;
	double *mati;
	unsigned int m,n,LEN,i,isj,j;


	/* Check for proper number of arguments */


	if (nrhs < 2) {
		mexErrMsgTxt("INCSAVE requires at least two input arguments.");
	} else if (nlhs > 0) {
		mexErrMsgTxt("INCSAVE has no output argument.");
	}

	
	if (!mxIsString(prhs[0])){
		mexErrMsgTxt("First argument must be a file name");
	}
	
	LEN = mxGetN(prhs[0])+1;
	if (LEN<2){
		mexErrMsgTxt("First argument must be a file name");
	}
	file=mxCalloc(LEN,sizeof(char));
	mxGetString(prhs[0],file,LEN);
	fp=matOpen(file,"u");

	if (fp==NULL)
	{
		mexErrMsgTxt("Error opening file");
	}
	i=0;
	while (i

          
Last modified: 16 March 2004, 15:32 UTC
Search   Site map