Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Linear Algebra and the C Language/a00u

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

__NOTOC__ Install this file in your working directory. /* ------------------------------------ */ /* Save as : vpoctave.h */ /* ------------------------------------ */ void p_Octave_mR( double **A, char name[], int Pn ) { int r; int c; printf(" %s=[\n",name); for(r=R1; r<A[R_SIZE][C0]; r++) { for (c=C1; c<A[C_SIZE][C0]; c++) printf("%+.*f,",Pn,A[r][c]); if((r+1)<A[R_SIZE][C0]) printf("\b;\n"); else printf("\b]\n\n"); } } /* ------------------------------------ */ /* ------------------------------------ */ /* ------------------------------------ */ void pE_Octave_mR( double **A, char name[], int Pn ) { int r; int c; printf(" %s=[\n",name); for(r=R1; r<A[R_SIZE][C0]; r++) { for (c=C1; c<A[C_SIZE][C0]; c++) printf("%+.*e,",Pn,A[r][c]); if((r+1)<A[R_SIZE][C0]) printf("\b;\n"); else printf("\b]\n\n"); } } /* ------------------------------------ */ /* ------------------------------------ */ void pAi_Octave_mR( double **A, char name[], int i, int Pn ) { int r; int c; printf(" %s%d=[\n",name,i); for(r=R1; r<A[R_SIZE][C0]; r++) { for (c=C1; c<A[C_SIZE][C0]; c++) printf("%+.*f,",Pn,A[r][c]); if((r+1)<A[R_SIZE][C0]) printf("\b;\n"); else printf("\b]\n\n"); } } /* ------------------------------------ */ /* ------------------------------------ */ void pEAi_Octave_mR( double **A, char name[], int i, int Pn ) { int r; int c; printf(" %s%d=[\n",name,i); for(r=R1; r<A[R_SIZE][C0]; r++) { for (c=C1; c<A[C_SIZE][C0]; c++) printf("%+.*e,",Pn,A[r][c]); if((r+1)<A[R_SIZE][C0]) printf("\b;\n"); else printf("\b]\n\n"); } } /* ------------------------------------ */ /* ------------------------------------ */ The pAi_Octave_mR(); function allows you to introduce an index (0,1,...) when working with matrix arrays.