# Wrong type for input argument #1: A real matrix expected. https://www.umr-cnrm.fr/spip.php?article23&lang=e

**URL:** <https://scilab.discourse.group/t/wrong-type-for-input-argument-1-a-real-matrix-expected-https-www-umr-cnrm-fr-spip-php-article23-lang-e/356>\
**Category:** General usage\
**Created:** [January 22, 2024, 10:28am UTC](https://scilab.discourse.group/t/wrong-type-for-input-argument-1-a-real-matrix-expected-https-www-umr-cnrm-fr-spip-php-article23-lang-e/356 "2024-01-22T10:28:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shawn](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@Shawn](https://scilab.discourse.group/u/Shawn)\
**Post date:** [January 22, 2024, 10:28am UTC](https://scilab.discourse.group/t/wrong-type-for-input-argument-1-a-real-matrix-expected-https-www-umr-cnrm-fr-spip-php-article23-lang-e/356/1 "2024-01-22T10:28:10Z")

</div>

Hello， I executed the code, but I faced this issue. Could someone more knowledgeable please take a look?

 ![image](https://global.discourse-cdn.com/free1/uploads/utc/original/1X/2986b50edab1f10da9d80178e91121825c805286.jpeg)

---

<div class="post-metadata">

**Author:** ![mottelet](https://yyz2.discourse-cdn.com/free1/user_avatar/scilab.discourse.group/mottelet/32/13_2.png) [@mottelet](https://scilab.discourse.group/u/mottelet)\
**Post date:** [January 22, 2024, 10:45am UTC](https://scilab.discourse.group/t/wrong-type-for-input-argument-1-a-real-matrix-expected-https-www-umr-cnrm-fr-spip-php-article23-lang-e/356/2 "2024-01-22T10:45:55Z")

</div>

Hello,

Welcome to Scilab discourse !

As a new user you may (or may not, apparently) have read the forum guidelines (see [Welcome to the Scilab discourse forum!](https://scilab.discourse.group/t/welcome-to-the-scilab-discourse-forum/7)), hence your message can be quite confusing for people who will try to help you: I mean, pasting a bunch of code without even saying “hello” is not very engaging.

Since the author of this code is a real person, why don’t you try to contact him directly? If you don’t succeed in that first step, we can help you if you focus more your question.

S.

---

<div class="post-metadata">

**Author:** ![Shawn](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@Shawn](https://scilab.discourse.group/u/Shawn)\
**Post date:** [January 22, 2024, 11:23am UTC](https://scilab.discourse.group/t/wrong-type-for-input-argument-1-a-real-matrix-expected-https-www-umr-cnrm-fr-spip-php-article23-lang-e/356/3 "2024-01-22T11:23:08Z")

</div>

Thanks for the reminder, I tried running and solving this bug myself but it didn’t work out in the end

---

<div class="post-metadata">

**Author:** ![mottelet](https://yyz2.discourse-cdn.com/free1/user_avatar/scilab.discourse.group/mottelet/32/13_2.png) [@mottelet](https://scilab.discourse.group/u/mottelet)\
**Post date:** [January 22, 2024, 12:52pm UTC](https://scilab.discourse.group/t/wrong-type-for-input-argument-1-a-real-matrix-expected-https-www-umr-cnrm-fr-spip-php-article23-lang-e/356/4 "2024-01-22T12:52:53Z")

</div>

You already had a partial aswer in another post (please avoid cross-posting on the same subject) for `stacksize` which is obsolete since Scilab 6.0. A quick look at the files shows other obsolete constructs (the files were written for Scilab 5). They can be detected by running `examples/main_3x.sce`:

```auto
cd RofPack_v1-0/examples/
exec("main_3x.sci")

```

- in main\_3x.sci remove line 23: `stacksize(2*10^8)`
- in consist\_mc\_tls.sci remove line 79: `return d_cons_H0` and add `endfunction` instead
- in gke.sci remove line 22: `return pv`

the main\_3x.sci script should run with output:

```auto
  "Residual Consistency Check"

--> // Main output: Beta_hat

--> Beta_hat = zeros(3,I);

--> Beta_hat = [beta_hat_inf; beta_hat; beta_hat_sup];

```

and the Beta\_hat matrix value is

```plaintext
--> Beta_hat
 Beta_hat = 

   0.3289068 -1.3307499 0.3404284
   0.7174227 -0.0289888 0.8981243
   1.0327693 1.005474 1.5890112

```

---

<div class="post-metadata">

**Author:** ![Shawn](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@Shawn](https://scilab.discourse.group/u/Shawn)\
**Post date:** [January 22, 2024, 2:26pm UTC](https://scilab.discourse.group/t/wrong-type-for-input-argument-1-a-real-matrix-expected-https-www-umr-cnrm-fr-spip-php-article23-lang-e/356/5 "2024-01-22T14:26:33Z")

</div>

Thank you, I get it.
