[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how to print the values of the variables in a loop?

From: Arnau Mir Torres
Subject: how to print the values of the variables in a loop?
Date: Tue, 14 May 2002 13:21:39 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0rc1) Gecko/20020417

I have an m file called file.m with the following:

for i = 1:10
tf = 1000.*i;
ll = 5.*10^(-4);
[z, ier, nfun, err] = quad ("g", 0, ll, [1e-12,1e-14]) ;
jph (i) = z;
error (i) = err;
nnfun (i) = nfun;
iier (i) = ier;
printf("i= %d, jph(%d)=%1.15e, error(%d)=%1.5e, nnfun(%d)=%1.5e, iier(%d)=%1.5e\n",i,i,jph(i),i,error(i),i,nnfun(i),i,iier(i));

If I do
and next I do
then octave executes all the loop and at the end, it prints the values of i, jph, etc.
My question is:
how can I do to print the values of the variables while octave is in the loop. That is, I want to know the value of jph(2) for example when octave even doesn't arrive at the end of the loop.

Thanks in advance,


Arnau Mir Torres
Departament de Matem?tiques i Inform?tica
Universitat de les Illes Balears
Edifici A. Turmeda
Ctra. de Valldemossa, km. 7,5
E-07071 Palma de Mallorca
Phone: 00 34 971 172561
Fax: 00 34 971 173003
e-mail: address@hidden

Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]