Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: Français - Português - Русский - 日本語
Scilab Help >> Scilab > Scilab keywords > ans

ans

answer

Description

ans means "answer". Variable ans is created automatically when expressions are not assigned. ans contains the last unassigned evaluated expression.

Variable ans is not protected by predef.

Examples

2+2
ans // 4
ans=10 // 10
clear ans
a=2+2;
isdef("ans") // F

See Also

  • predef — variable protection

Comments

Author : Peter Cusack posted the 09/02/2011 02:00
It might be trivial, but an example should be included for completeness.

Reply to this comment
Please login to comment this page

Author : Allan CORNET posted the 09/02/2011 10:25
-->3
ans =

3.

-->ans
ans =

3.

-->str = "Hello"
str =

Hello

-->ans
ans =

3.

-->str
str =

Hello

-->ans
ans =

3.
Reply to this comment
Please login to comment this page


Add a comment:
Please login to comment this page.

Report an issue
<< Scilab keywords Scilab keywords backslash >>

Scilab Enterprises
Copyright (c) 2011-2015 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Wed Jun 15 08:27:30 CEST 2016