0

Details of the Problem:
I'm developing a Scilab-based toolbox for spacecraft guidance and navigation control. While attempting to build macros for the toolbox, specifically during the processing of the System_IF.sci file, I encountered a syntax error:

genlib: Error in file C:\Users\Vimal\Desktop\spacecraft-gnc-tbx-devel-kalman-filter-block\macros\System_IF.sci.
exprs = list(
^
Error: syntax error, unexpected end of line

The error occurs at the initialization of the exprs list, where I am trying to define the block parameters for a Scicos model. The build process fails at this point, even though similar list syntax works fine in other parts of the project.

I've verified the usage of the list function according to Scilab documentation, but I still can't resolve the error. It appears to be related to the macro-building process in Scilab 2024.0.0.

Body:
I'm working on building macros for a spacecraft guidance and navigation control toolbox in Scilab 2024.0.0. During the build process, I'm encountering the following error:

genlib: Processing file: System_IF.sci
at line    58 of function genlib             
at line    42 of function tbx_build_macros   
at line     6 of function buildmacros        
at line    14 of executed file C:\Users\Vimal\Desktop\spacecraft-gnc-tbx-devel-kalman-filter-block\macros\buildmacros.sce
at line    13 of function tbx_builder        
at line    40 of function tbx_builder_macros 
at line    35 of function main_builder       
            exprs = list(
^
Error: syntax error, unexpected end of line
genlib: Error in file C:\Users\Vimal\Desktop\spacecraft-gnc-tbx-devel-kalman-filter-block\macros\System_IF.sci.

This is a snippet of the function System_IF.sci where the error seems to occur:

exprs = list(
    'eye(4)',
    '[0; 0; 0; 0]',
    '[1, 0, 0, 0]',
    '0',
    '[0; 0.1; 0; 0.1]'
);

I'm trying to define expressions for a Scicos block model, but I keep getting this syntax error. I've reviewed the list initialization, but I don't see anything obviously wrong.

Could this be an issue with the Scilab version or with how I'm using the list function in the context of exprs? Any insights or suggestions on how to resolve this error would be appreciated.

What I Tried:

I reviewed the code to ensure that the list function was being used correctly. In Scilab, I believe the list syntax should allow for multiple elements, including matrices and scalars, as I have written in the exprs definition. I tried commenting out different parts of the function to isolate the error and confirmed that the issue occurs around the exprs = list(...) initialization. I also checked Scilab documentation to verify the proper usage of list and compared it with similar code that works fine in other functions. I tried running the build process in a clean environment with the latest version of Scilab (2024.0.0) to ensure it's not a version-specific issue. What I Expected:

I expected the macro to build successfully, with the exprs list correctly defining the block model parameters for the System_IF function. The exprs should initialize without any syntax errors, allowing me to proceed with building the spacecraft guidance and navigation control toolbox.

2
  • Python or another language format doesnot work in Scilab. It's resolved Commented Sep 30, 2024 at 6:57
  • The right answer is below exprs = list(... 'eye(4)',... '[0; 0; 0; 0]',... '[1, 0, 0, 0]',... '0',... '[0; 0.1; 0; 0.1]'... ); Commented Oct 2, 2024 at 20:30

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.