help-octave
[Top][All Lists]
Advanced

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

Re: eliminte "ans" and print file as is on the screen


From: Doug Stewart
Subject: Re: eliminte "ans" and print file as is on the screen
Date: Thu, 10 Jan 2019 06:43:07 -0500



On Thu, Jan 10, 2019 at 6:36 AM Doug Stewart <address@hidden> wrote:


On Thu, Jan 10, 2019 at 6:06 AM eugenia <address@hidden> wrote:
Hi!
since a few days I am trying to plot something. I think I found a way but I
need to print a file with the same format I see on the screen but I need to
eliminate "ans".
I have a variable CHIS1.
>> disp(CHIS1(1,:,:))
ans(:,:,1) =

   3.3208e-04   3.6136e-04   3.4397e-04   3.2282e-04   3.0488e-04 
3.5576e-04

ans(:,:,2) =

   7.8157e-04   6.4418e-04   6.8477e-04   5.5001e-04   4.8390e-04 
4.0325e-04

ans(:,:,3) =

3.9184e-04   2.5231e-04   4.5585e-04   3.9979e-04   3.8978e-04   0.0000e+00
.
..

An I want to print this in a file (without "ans")  with this format:

   3.3208e-04   3.6136e-04   3.4397e-04   3.2282e-04   3.0488e-04 
3.5576e-04
   7.8157e-04   6.4418e-04   6.8477e-04   5.5001e-04   4.8390e-04 
4.0325e-04
  3.9184e-04   2.5231e-04   4.5585e-04   3.9979e-04   3.8978e-04 
0.0000e+00
.
.


I tried to apply many instructions on the web but they didn't work... Can
somebody help me?

Regards,
Marie Eugenia




here is one way:

clear
a=rand(2,3,6);
for k=1:6
q(:,k)=a(1,:,k);
endfor
display(q)

what the trick here is---  to make it into a 2d array first then display it.
I hope this helps.
Doug
 
--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html





try this
clear
a=rand(2,3,6);
for k=1:6
q(:,k)=a(1,:,k);
endfor
display(q)
save out.dta -ascii q
 

--
DASCertificate for 206392



--
DASCertificate for 206392


reply via email to

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