Hi I am new to scilab and don’t have much mathematical background.
I have been following code for another example and am being shown error 10000 for the following code:
function [z]=f(x,y)
z=0.026*(1.0-(y/ym))*y;
endfunction;
ym=12000;
x0=1950;y0=2555;xn=5;h=10;
x=[x0:h:xn];
y=ode("rk",y0,x0,x,f);
disp("x y")
disp("--------")
disp([x'y']);
function z=fe(x)
z=ym/(1-(1-ym/y0)*e^(-k*(t-t0)));
endfunction;
xe=(x0:h/10:xn);
n=length(xe)
for i=1:n
ye(i)=fe(xe(i));
end;
plot (x,y,'ro',xe, ye,'-b');legend ('rk4','Exact',3);
xtitle('solving dy/dx=k(1-y/ym)y','x','y');
I have worked through several other error messages. I am lost and don’t know if the problem is in the code or the way I set up the problem. The following is the current error message:
!--error 10000
plot: Wrong size for input argument #2: A non empty matrix expected.
at line 57 of function checkXYPair called by :
at line 235 of function plot called by :
plot (x,y,'ro',xe, ye,'-b');legend ('rk4','Exact',3);
at line 25 of exec file called by :
I would appreciate any help.
Thanks
I am new to Scilab, but I do have MatLab and Octave experience. I’m just starting to write custom functions and when I try to load them into Scilab, I get the following error.
!--error 10000
listvarinfile: Wrong variable type (1.686D+08) found in '<pathname>\test.sci'. File may be wrong or corrupted.
at line 50 of function listvarFunction called by :
at line 29 of function listvarinfile called by :
at line 949 of function %_sodload called by :
<pathname>\test.sci'
In this case the test file was pretty simple:
function [x]=test(y)
x = y*y;
endfunction
saved with the .sci extension.
The function was loaded from the IDE by right clicking on the file and choosing the Load into Scilab option.
I had more complex examples but decided to write this since they were not loading either.
Thanks for your help.
Misa Lazovic
2,80510 gold badges32 silver badges38 bronze badges
asked Jun 2, 2014 at 21:53
1
Unlike in Matlab, in scilab you need run the function.
Just run the function first and then call it in the console .
test(4)
ans =
16.
answered Jun 3, 2014 at 16:07
user2240469user2240469
531 gold badge1 silver badge6 bronze badges
Just as user2240469 said, but you can do this in the console. See also the documentation of exec.
// Use -1 as mode to prevent printing everything in the console
-->exec('test.sci',-1)
-->test(4)
ans =
16.
answered Jun 4, 2014 at 11:21
spoorccspoorcc
2,9072 gold badges21 silver badges29 bronze badges
Please note that the recommended version of Scilab is 2023.1.0. This page might be outdated.
See the recommended documentation of this function
Scilab Help >> Scilab > Error handling > error
Calling Sequence
error(message) error(message, n) error(n) error(n, message) error(n, pos)
Arguments
- message
-
a string or a vector of strings. The error message to be displayed.
- n
-
an integer. The number associated with the error message.
- pos
-
an integer. A parameter for the error message.
Description
error
function allows to issue an error message and to
handle the error. By default error
stops the current
execution and resume to the prompt level. This default can be changed
using the errcatch
or execstr(...,'errcatch')
functions.
error(message)
prints the character string contained in
message
. The number associated with the error message is
10000
error(message,n)
prints the character string contained in
message
. The number associated with the error message is
given by n
. This number should be greater than 10000.
error(n)
prints the predefined error message associated with
the error number n
.
Some predefined error messages require a parameter (see
error_table). In this case the pos
argument must be used error(n,pos)
to give the parameter
value. In the other cases the pos
argument is ignored.
See error_table for a list of error messages and the
associated error numbers.
Examples
error('my error message') error(43) error(52, 3) error(10001, ['A'; 'multi';'line';'error';'message']) lasterror()
See Also
- warning — warning messages
- errcatch — error trapping
- execstr — execute Scilab code in strings
- lasterror — get last recorded error message
- error_table — table of error messages
- messagebox — Open a message box.
History
Version | Description |
5.4.0 | The error function can take vector of strings as input argument. |
Я столкнулся с проблемой при загрузке набора инструментов SIVP в консоли Scilab. Я использую scilab 5.5.0. Я установил libtiff4. Я получаю следующую ошибку. Может кто-нибудь, пожалуйста, помогите?
SIVP - Scilab Image and Video Processing Toolbox
Load macros
Load gateways
atomsLoad: An error occurred while loading 'SIVP-0.5.3.1-2':
link: The shared archive was not loaded: libtiff.so.4: cannot open shared object file: No such file or directory
!--error 10000
at line 335 of function atomsLoad called by :
atomsLoad SIVP
2014-04-30 05:56
2
ответа
У меня такая же проблема. Я использую Fedora 20. Перейдите в папку lib и проверьте, есть ли у вас libtiff.so.4, у вас, вероятно, нет этого файла, иначе вы не получили бы эту ошибку. Тем не менее, вы можете иметь libtiff.so.5 или.3. Если у вас более старая версия, просто установите.4, установив openCV. Если у вас есть.5, то вам нужно создать символическую ссылку, как sudo -c 'ln -s libtiff.so.5 libtiff.so.4
Это решает проблему в Linux.
2014-05-23 14:25
У тебя есть либтиф?
Если нет, и вы используете Ubuntu
sudo apt-get install libtiff4
2014-04-30 07:07
Другие вопросы по тегам
scilab
Hi All,
I’m new(bie) to Scilab (4.1.2), then sorry if my problem is too
simple. But I’m trying to compile one example of the function
«addmenu». The result was
code=[ ‘#include «»machine.h»»‘
—> ‘void foo(char *name,int *win,int *entry)’
—> ‘{‘
—> ‘ if (*win==-1) ‘
—> ‘ sciprint(«»menu %s(%i) in Scilab window selected\r
\n»»,name,*entry+1);’
—> ‘ else’
—> ‘ sciprint(«»menu %s(%i) in window %i selected\r\n»»,name,*entry
+1,*win);’
—> ‘}’];
—>dir=getcwd(); chdir(TMPDIR)
Warning :redefining function: dir
ans =
0.
—>mputl(code,TMPDIR+’/foo.c’);
—>ilib_for_link(‘foo’,’foo.o’,[],’c’);
generate a loader file
generate a Makefile: Makelib
running the makefile
compilation of foo
‘nmake’ nÆo ‚ reconhecido como um comando interno
ou externo, um programa oper vel ou um arquivo em lotes.
!—error 10000
unix_s: error during «nmake /nologo /f Makelib.mak foo.obj»
execution
at line 50 of function unix_s called by :
line 25 of function ilib_compile called by :
line 29 of function ilib_for_link called by :
ilib_for_link(‘foo’,’foo.o’,[],’c’);
What I should do to fix this error? Thanks.