LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, 04:03 PM   #1
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
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, 04:49 PM   #2
terry-duell
Member
 
Registered: Jan 2007
Location: Melbourne, Australia
Distribution: Fedora 38 x86_64
Posts: 539

Rep: Reputation: 59
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, 08:37 AM   #3
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Original Poster
Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
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



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 08:18 AM
matrix screen saver tommytomato Fedora 2 05-26-2007 08:25 PM
Matrix screen control DarkNecromancer Slackware 0 04-04-2007 12:39 AM
How to implement Vector * Matrix in THIS WAY? ArthurHuang Programming 6 03-06-2006 03:19 AM
Frivolous question: Why is my Matrix screen saver not working? Arg! Surfrider Linux - Newbie 1 09-05-2005 07:17 AM

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

All times are GMT -5. The time now is 05:08 PM.

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
Open Source Consulting | Domain Registration