Export matrix to matlab

Dear all,

from versions 4.x of FreeFem, the default format for exporting sparse matrices has changed from Morse to Hash.
Is there anyway to force FreeFem to save the sparse matrices in Morse format?
Or is there any matlab code, like FFmatrix_fread, to read hash matrices in Matlab?

Thank you for your attention,

Tom

see example tutorial/sparse-matrix.edp

pass the matrix in CSR format before to write

tutorial/sparse-matrix.edp: MM.CSR;
tutorial/sparse-matrix.edp: cout << " MM (format CSR or Morse) "<< MM << endl;

Bonjour à tous ceux qui liront,

Ci-joint un code matlab (FF_matrix_fread.m) qui permet d’importer dans la classe SPARSE de matlab des matrices construites par FF++. Les formats FF++ pris en compte sont Morse (CSR), HashMatrix (COO) et Matrix_Market.

Un script de validation également joint. Il faudra générer ses propres matrices.

Ce script de validation contient aussi un méthode matlab très légère (mais sans aucun contrôle et pas boite noire) d’importation dans matlab. Cette seconde méthode nécessite les commandes cat et grep.

Je vous remercie.

FF_matrix_fread_src_et_valid.zip (7.2 KB)