I'm trying to read a matrix from a file to Octave and then apply a svd. As example, the following matrix in a text file called "teste.txt":
1 3 -2 3
3 5 1 5
-2 1 4 2
I'm trying to execute the following script in octave:
data = dlmread ("teste.txt", "\t",0,0);
svd(data)
However, I'm facing the following error, which I don't know exacly why:
/home/thiago/Documents/svd.oct: invalid ELF header
error: called from:
error: /home/thiago/Documents/svd.oct at line 2, column 1
Does anybody have any clue? I'm executing it on Ubuntu 14.04 and the file separator is a tab(\t).
Thank you very much in advance,
Thiago.
Related
Currently, I have a text file and I'm interested in plotting two different curves from a single file(values for x axis are the same-column 1, values for y axis-columns 3 and 4). The plot should be in STDOUT since I'm working from ssh. The file that I am working with looks like this (filename: tmp)
%Iter duration train_objective valid_objective difference
0 6.0 0.0195735 0.0610958 0.0415223
1 5.0 0.180216 0.191344 0.011128
2 5.0 0.223318 0.241081 0.017763
3 6.0 0.245895 0.262197 0.016302
4 6.0 0.25796 0.28056 0.0226
5 6.0 0.269223 0.291769 0.022546
6 5.0 0.281187 0.298474 0.017287
7 5.0 0.283891 0.305579 0.021688
8 5.0 0.296456 0.307381 0.010925
9 5.0 0.296856 0.315487 0.018631
10 5.0 0.295805 0.321391 0.025586
Total training time is 0:06:27
So far, I can only plot the values corresponding to the 3rd column using the following line:
cat tmp | gnuplot -e "set terminal dumb size 120, 30; set autoscale; plot '-' u 1:3 with lines notitle"
Could someone tell me then how I could include the 4th column in the same plot? is that possible?
Thanks!
There is nothing in your description that rules out the trivial answer:
gnuplot -e "plot 'tmp' u 1:3 with lines, '' u 1:4 with lines"
The terminal choice is not relevant (you used 'set term dumb' but it could just as easily be any other output terminal, connection via ssh does not prevent that). If you have additional constraints that require a more complicated solution, please add them to the question.
I want to create a pretty printed table from a matrix (or column vector).
For Matlab there are several available functions that can do this (such as printmat, array2table, and table), but for Octave I cannot find any.
So instead of:
>> a = rand(3,2)*10;
>> round(a)
ans =
2 10
1 3
2 1
I would like to see:
>> a = rand(3,2)*10;
>> pretty_print(round(a))
THIS THAT
R1 2 10
R2 1 3
R3 2 1
How can I produce a pretty printed table from a matrix?
(Any available package to do so?)
UPDATE
After trying to follow the extremely obtuse package installation instruction from Octave Wiki, I kept getting the error pkg: failed to read package 'econometrics-1.1.1.tar.gz': Couldn't resolve host name. Apparently the windows version isn't able to use the direct installation command (as given on their Wiki). The only way I managed to get it, was by first downloading the package manually into the current working directory of Octave. (See pwd output.) Only then did the install command work.
pkg install econometrics-1.1.1.tar.gz
pkg load econometrics
Yes, there is a prettyprint function in the econometrics package. Once the package is installed and loaded, you can use it like this:
>> a = rand(3,2)*10;
>> prettyprint(round(a),['R1';'R2';'R3'],['THIS';'THAT'])
THIS THAT
R1 2.000 3.000
R2 3.000 4.000
R3 10.000 3.000
I hope somebody can help me .. I try to open a new entry in a joomla menu and get the following error output:
0 Cannot use object of type stdClass as array
/mnt/web208/e2/01/56797301/htdocs/plugins/system/helix3/helix3.php:55
error output
Function Location 1 () JROOT/plugins/system/helix3/helix3.php:55 2 plgSystemHelix3->onContentPrepareForm() JROOT/libraries/joomla/event/event.php:70
3 JEvent->update() JROOT/libraries/joomla/event/dispatcher.php:160
4 JEventDispatcher->trigger() JROOT/libraries/src/MVC/Model/FormModel.php:321
5 Joomla\CMS\MVC\Model\FormModel->preprocessForm() JROOT/administrator/components/com_menus/models/item.php:1254
6 MenusModelItem->preprocessForm() JROOT/libraries/src/MVC/Model/FormModel.php:242
7 Joomla\CMS\MVC\Model\FormModel->loadForm() JROOT/administrator/components/com_menus/models/item.php:552
8 MenusModelItem->getForm() JROOT/libraries/src/MVC/View/HtmlView.php:423
9 Joomla\CMS\MVC\View\HtmlView->get() JROOT/administrator/components/com_menus/views/item/view.html.php:58
10 MenusViewItem->display() JROOT/libraries/src/MVC/Controller/BaseController.php:672
11 Joomla\CMS\MVC\Controller\BaseController->display() JROOT/administrator/components/com_menus/controller.php:75 12 MenusController->display() JROOT/libraries/src/MVC/Controller/BaseController.php:710
13 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/administrator/components/com_menus/menus.php:18
14 require_once() JROOT/libraries/src/Component/ComponentHelper.php:382
15 Joomla\CMS\Component\ComponentHelper::executeComponent() JROOT/libraries/src/Component/ComponentHelper.php:357
16 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/AdministratorApplication.php:101
17 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT/libraries/src/Application/AdministratorApplication.php:159
18 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:195
19 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/index.php:51
The error occurred in the file helix3.php on line 55. Plugging the displayed notation ("helix3.php:55", with the quotes) into Google yields this page as first result:
https://www.joomshaper.com/forums/helix3-plugins-causing-joomal-menu-to-not-work-0-cannot-use-object-of-type-stdclass-as-array
This site states it's a known bug and an update will be released soon. Try to update the plugin, or modify the helix3.php file as explained.
And please use Google (or another search engine of your liking) before posting a question. Filenames + Line numbers as well as paths and the first sentence of error messages make for great search terms.
PS: Welcome on StackOverflow!
Hello I am building a genome assembly method and a critical step of my pipeline is phasing. I've been searching through different methods and recently discovered H-PoPG which looks promising for polyploid haplotyping. I am trying to test my data on it but I got the following result and couldn't find any help or forum on the web.
This is the command I am using:
java -jar H-PoPG.jar -p 3 -w 0.9 -f fragment_matrix_Chrm1 -vcf PilonChrm1.vcf -o output_phased_Chrm1
This is the error message:
Exception in thread "main" java.lang.NullPointerException
at algorithms.HBOP2Builder.<init>(HBOP2Builder.java:59)
at algorithms.HBOP2Builder.<init>(HBOP2Builder.java:25)
at algorithms.HPBOP2Alg.buildHaplotype(HPBOP2Alg.java:24)
at main.PolyPlotyping.Polyphasing(PolyPlotyping.java:224)
at main.PolyPlotyping.go(PolyPlotyping.java:159)
at main.PolyPlotyping.main(PolyPlotyping.java:280)
srun: error: neumann: task 0: Exited with exit code 1
Could anyone point me in the right direction by explaining me where this error could come from?
Many Thanks
I have run your data and found it is OK to run the command without the vcf file.
The error messages occur when it is run with the vcf file.
The vcf file contains many overlaps such as:
Chromosome_1_Reference 16 . A . 1486 LowCov DP=39;TD=43;BQ=38;MQ=57;QD=38;BC=39,0,0,0;QP=100,0,0,0;PC=119;IC=0;DC=0;XC=0;AC=0;AF=0.00 GT 0/0
Chromosome_1_Reference 16 . AAACCC A . Amb;LowCov DP=56;TD=60;BQ=39;MQ=57;QD=25;BC=19,21,0,0;QP=48,52,0,0;PC=119;IC=0;DC=16;XC=1;AC=1;AF=0.29 GT 0/1
Chromosome_1_Reference 17 . A C 1018 Amb;LowCov DP=56;TD=60;BQ=39;MQ=57;QD=25;BC=19,21,0,0;QP=48,52,0,0;PC=119;IC=0;DC=16;XC=1;AC=1;AF=0.52 GT 0/1
Please check the vcf file and ensure that every SNP position is covered by only one line,
and that the last column of each line should be 0/0/1 or 0/1/1 when the polyploidy is 3 (-p 3).
I am trying to use the for syntax for multiple columns.
I have a data file colhead.dat:
Id a1 a2 a3
1 1 2 3
2 2 3 4
3 2 3 4
Following the answer https://stackoverflow.com/a/17525615/429850, I do
gnuplot> plot for [i=2:5] 'colhead.dat' u 1:i w lp title columnheader(i)
^
':' expected
How do i write the for loop? Here's the gnuplot version header
Version 4.2 patchlevel 6
last modified Sep 2009
System: Linux 2.6.32-71.el6.x86_64
For-loops have been implemented in version 4.6 of gnuplot, and there was nothing like loops in the versions before. So you have to update your version!
Edit: As Christoph mentioned, first for functionality was introduced in 4.4. However, 4.2 is too old.