Compatibility or syntax issue while running a 2014 script ?
Mostrar comentarios más antiguos
Hello,
I'm trying to run a script (written under the R2012b version of mathlab) with the R2016a matlab version, but I have few warnings and the program can't be run. The script is part of a method (ARTIST) used to analyse a biology experiment (Tn-seq) that the authors published in the journal Plos Genetics in 2014 (so it is supposed to work, or was). My problem is that, when the first function is called, an error occurs and I get this message: 'Unexpected MATLAB expression.'.The error refers to the second input of the first function:
function [Chr1_names, Chr1_starts, Chr1_ends, TAsites, TAid] = genome_parser_TA (VCgft, *'chrI'*, 2961149, 'VC_chr1.fa', 'TA')
Imputs are from different types (table, number, character chain, or a reference to a file on the workspace) (I don't know if it is important or not). I have several errors here, 3 imputs are issues ('chrI', 2961149 and 'VC_chr1.fa') and the last parenthesis is one too. When I pass my cursor over the warnings I get different messages:
- For 'chrI', it is written: Parse error at "chrI": usage might be invalid MATLAB syntax.There is the same error with the parenthesis. (is it produced by the first error or because the software can't recognize the function ?)
- For the two last warnings, it is said: "Terminate statement with semicolon to supress output (within a script).
Does someone know what would be the issue I experience here ?
I am a beginner with this sowftware, as I'm testing the software and the method quoted above. Thus, I don't clearly know what would be the problem here. However I fear one: might these errors be created by the evolution of the MATLAB syntax over the passed versions thus making the script obsolete ?
Thanks in advance for your answers,
Quentin.
Respuesta aceptada
Más respuestas (1)
Guillaume
el 24 de Ag. de 2016
function ... = ...(x, *'chrI'*, xx, 'VC_chr1.fa', 'TA')
This has never been valid syntax in matlab. Neither * nor ' can be included in variable names. This code would not work under 2012b either.
Possibly, remove the * and ' in that function declaration and see if it works.
6 comentarios
Quentin
el 24 de Ag. de 2016
Guillaume
el 24 de Ag. de 2016
Can you attach the function or at least show the code for the line that is causing problem.
Guillaume
el 25 de Ag. de 2016
Please show the exact code that you use to call the function. For the function to work, you would have to call it with at least:
out1 = genome_parser(arg1) %replace arg1 with actual name of variable.
And if all inputs are required:
out1 = genome_parser(arg1, arg2, arg3, arg4, arg5); %replace argx by actual input variable.
And if you need all outputs:
[out1, out2, out3, out4, out5] = genome_parser(____); %replace outx by actual output variable
Quentin
el 29 de Ag. de 2016
Categorías
Más información sobre Matrix Indexing en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!