LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-22-2010, 05:03 PM   #1
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,665

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Octave (v3.2): initialize vector/matrix without screen output


Hi,

I have recently installed Octave on my desktop and I am very busy with RTFM ATM.
However, this manual is huge and I could not find an answer to my problem. What I basically want to do is initialize a vector like
Code:
a=[]
for i 1:100
  a = [ a i ]
endfor
Now my problem is that this will call the pager and I have to hit 'q' to get my prompt back. I know I can turn it off but the screen will still get cluttered with tons of output.
Is there a way to initialize 'a' quietly without any screen output?
 
Old 10-22-2010, 05:49 PM   #2
terry-duell
Member
 
Registered: Jan 2007
Location: Melbourne, Australia
Distribution: Fedora 28 x86_64
Posts: 497

Rep: Reputation: 47
Quote:
Originally Posted by crts View Post
Hi,

I have recently installed Octave on my desktop and I am very busy with RTFM ATM.
However, this manual is huge and I could not find an answer to my problem. What I basically want to do is initialize a vector like...
[snip]
There is an Octave mailing list, which is where you can be sure to get some help.
Try <https://www-old.cae.wisc.edu/mailman/listinfo/help-octave>

Cheers,
Terry
 
Old 10-23-2010, 09:37 AM   #3
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,665

Original Poster
Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Ok,

after some more RTFM I found a workaround to the problem. You can open /dev/null for writing and assign it to a filedescriptor. Then you can use the fdisp() function to send all the output to that "file".
Procedure:
Code:
dnul = fopen("/dev/null","w")
a=[]
for i 1:100
  fdisp(dnul, a=[a i])
endfor
This will produce not output on the screen and initialize the matrix/vector 'a' quietly.

@terry: Thanks for the link, but I did not want to subscribe to the list (yet). I will keep it in mind though.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
quiet headphone output, vector linux deathalele Linux - Hardware 1 12-07-2008 09:18 AM
matrix screen saver tommytomato Fedora 2 05-26-2007 09:25 PM
Matrix screen control DarkNecromancer Slackware 0 04-04-2007 01:39 AM
How to implement Vector * Matrix in THIS WAY? ArthurHuang Programming 6 03-06-2006 04:19 AM
Frivolous question: Why is my Matrix screen saver not working? Arg! Surfrider Linux - Newbie 1 09-05-2005 08:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration