[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: octave matrix output input
From: |
Laurent Mazet |
Subject: |
Re: octave matrix output input |
Date: |
Fri, 5 Nov 2004 11:44:43 +0100 |
On Fri, 05 Nov 2004 11:27:03 +0100
"Bernard.ROUSSELET" <address@hidden> wrote:
> Hello
> I am new to octave that I am using for e learning using wims.unice.fr;
> in order to work with a mtrix, wims need to recognize it but i I enter a
> mtrix
> a=[1,2;3,4], octave displays
> 1 2
> 3 4
> without commas , and semi column ;
>
> I have looked in the doc, in the FAQ and in the help archive without
> finding how to ask octave to output a matrix in the same way we enter
> it (ie with: comma , and semi column ; )
> can you help me?
printf("[");
for k=1:rows(a);
printf(repmat("%g,", 1, columns(a))(1:end-1), a(k,:));
printf(";");
endfor;
printf("]\n");
--
Dr. Laurent Mazet: Research Engineer /V\ Centre de Recherche de MOTOROLA
Tel: +33 (0)1 69 35 48 30 =-=-=-=-=-=-=-=-=-=-= Email: address@hidden
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------