Xcos throws "Undefined variable: scifunc_block_m" message in console

594 Views Asked by At

When I run a Xcos model containing a scifunc_block_m block like shown below xcos_model I get an error message relating to data dimensions inconsistency:

"Data dimensions are inconsistent:"
" Variable size=[1,1]"
"Block output size=[100,1]."

But when I double click in the block in order to see what can I change to make the dimensions correct I get a message in the console saying

Undefined variable: scifunc_block_m

What bugs me is that scifunc_block_m is not the name of any variable, but rather the name of the block itself like can be seen in the official docs. Of course I double checked that nowhere in my function phase_shifter neither anywhere else I have any variable named like that.

I tried with Scilab 6.1.1 and 6.1.0 believing that it might be a bug from apparently not.

1

There are 1 best solutions below

0
S. Gougeon On

In your phase_shifter.sce file generating the input variable, the signalIn variable does not comply with the From Workspace block requirements, whose documentation says that the input variable

  • must be a structure with time and values fields
  • .time must be a column vector, and in your case
  • .values must also be a column

So,

t = (0:1/fs:Npp/fs - 1/fs);       // time vector 
signalIn = A*%e^(%i*w*t);

should be replaced with

t = (0:1/fs:Npp/fs - 1/fs)';       // time column vector
signalIn = struct("time",t, "values",A*%e^(%i*w*t));

This fixes the inconsistent dimensions message.

In addition, i am not able to reproduce your issue about Undefined variable: scifunc_block_m. The parameters interface opens as expected. You may get this kind of messages if you try to run some xcos parts out of xcos, without beforehand loading xcos-related libraries.

Then, we get an unclear "Output should be of complex type." message on the From workspace block. By the way, you try to plot some complex values. Please have a look to the MATMAGPHI block before entering MUX: https://help.scilab.org/docs/6.1.1/en_US/MATMAGPHI.html