Changeset 23508
- Timestamp:
- 12/06/18 14:23:58 (6 years ago)
- Location:
- issm/trunk-jpl/src/c/shared/Elements
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/shared/Elements/PrintArrays.cpp
r23255 r23508 49 49 _printf_("\n"); 50 50 } 51 void printarray_matlab(const char* filename,int* array,int lines,int cols){ 52 FILE *f = fopen(filename,"w"); 53 fprintf(f,"%% Matrix of size %ix%i\n",lines,cols); 54 fprintf(f,"\n"); 55 fprintf(f,"A=[...\n"); 56 for(int i=0;i<lines;i++){ 57 for(int j=0;j<cols;j++) fprintf(f," %i",array[i*cols+j]); 58 fprintf(f,"\n"); 59 } 60 fprintf(f,"];\n"); 61 fclose(f); 62 } 51 63 void printarray(bool* array,int lines,int cols){ 52 64 _printf_("\n"); -
issm/trunk-jpl/src/c/shared/Elements/elements.h
r23317 r23508 49 49 void printarray(IssmDouble* array,int lines,int cols=1); 50 50 #endif 51 void printarray_matlab(const char* filename,int* array,int lines,int cols=1); 51 52 void printarray(int* array,int lines,int cols=1); 52 53 void printarray(bool* array,int lines,int cols=1);
Note:
See TracChangeset
for help on using the changeset viewer.