Error on matlab get_param - matlab

I'm generating tlc files from a model. In a specific point I'm getting this error when calling get_param:
>> get_param('FGCS_Sim', 'TargetFcnLibHandle')
??? Error using ==> getTfl at 30 TFL: "None" cannot be found in the
registry.
Error in ==>
C:\MATLAB\R2008b\toolbox\rtw\rtw\#RTW\#TargetRegistry\getTflTableList.p>getTflTableList
at 18
??? Target Function Library 'None' is missing or does not contain a valid TFL Table.
This error is occurring in .p file, so I can't see what's happening. But when I try with a different parameter name (one that does not exist), I get a "normal" error:
>> get_param('FGCS_Sim', 'foo_boo_bar')
??? block_diagram does not have a parameter named 'foo_boo_bar'.
What could be happening?

propose to first check property
'TargetFcnLib'
If that equals 'None' - you will run into the reported error...

Related

Tanka - VS Code - "Unexpected type string" while getting namespace from spec file

I'm trying out Tanka for k8s configs generation. Also, I'm using VS Code extension by Grafana Labs.
I've problems in VS Code with referencing Tanka configuration as described here. I'm using configuration to retrieve namespace, like so:
local k = import 'k.libsonnet';
local tk = import 'tk';
{
namespace: k.core.v1.namespace.new(tk.env.spec.namespace),
}
Initially, I was receiving an error: RUNTIME ERROR: Undefined external variable: tanka.dev/environment. I supposed that Tanka wants path to my environment, and so added it to VS Code settings:
{
"jsonnet.languageServer.extVars": {
"tanka.dev/environment": "environments/default"
}
}
Now I'm receiving another error in the k.core.v1.namespace.new(tk.env.spec.namespace) expression:
RUNTIME ERROR: Unexpected type string, expected number
<path to repo>/environments/default/main.jsonnet:7:38-49
<path to repo>/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.25/_gen/core/v1/namespace.libsonnet:51:35-39 thunk from <function <anonymous>>
<path to repo>/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.25/_gen/core/v1/namespace.libsonnet:33:42-46 object <anonymous>
Field "name"
Field "metadata"
Field "namespace"
During manifestation
The error is quite confusing to me. What and where expects number?
both namespace and name are strings in my spec.json
according to the same configuration docs they should be strings
on line 33 of namespace.libsonnet there is a function withName which expects name argument of type d.T.string
tk works fine from the CLI
I suppose that I've set wrong tanka.dev/environment, but I can't find docs that say what should be set there.
Also, just to check if it helps, I tried setting "jsonnet.languageServer.tankaMode": true in VS Code settings to no avail.
Please, help me to resolve the error and if possible explain what's going on here.

Workbox 6: ReferenceError: swDest is not defined

Getting ReferenceError: swDest is not defined when trying to run Workbox 6.
In my sw_build.js file I have that I call with node sw_build.js in my package.json file...
In the console I see this as the output:
It appears as though the files get created?, I just don't understand why I'm getting the odd error.
Your swDest reference is in line 16, and swDest is not defined. That's why the file is created but error occurs. I think you copied the example code without modification on this line.

How to avoid the error thrown by the maxima function polynomialp?

Look at the following two sequences of two commands. They are the same up to the choice of variable a or z, but the version with a produces an error whereas the function with z does not.
First run (after a restart of maxima):
declare(a,constant); polynomialp(x^2+x+1/a,[x]);
Now replace a by z and there is no error when run (after a restart of maxima):
declare(z,constant); polynomialp(x^2+x+1/z,[x]);
The error reported in the case with variable a is:
define: in definition of dotproduct, found bad argument a
-- an error. To debug this try: debugmode(true);
Strangely enough, after running the second command of the first sequence again, the error does not recur.
Above code was run on Maxima versions 5.30 and 5.39.

MATLAB: error when importing matlab.io.fits

I am trying to create .fits files using the matlab.io.fits functions, following the example given here: matlab.io.fits.createFile.
However, this gives me the following error:
>> import matlab.io.*
>> fptr = fits.createFile('myfile.fits');
??? Undefined variable "fits" or class "fits.createFile".
Importing the fits class directly also gives an error:
>> import matlab.io.fits
??? Import argument 'matlab.io.fits' cannot be found or cannot be imported
I get the same result in Matlab2009 and 2015.
What am I doing wrong? Do I need to install a specific class? I am new to Matlab, so it might be a very easy mistake, but some of my more Matlab proficient colleagues has not been able to solve the problem.
This error indicate that the function cannot be found. This is usually caused by the MATLAB path being corrupted. You can restore it with:
>> restoredefaultpath
>> rehash toolboxcache
You can figure out if the file is found by executing:
>> which -all matlab.io.fits.createFile
The file should be in <matlabroot>/toolbox/matlab/imagesci/+matlab/+io/+fits/createFile.m. If it is not there, you probably need to reinstall MATLAB.

Arduino HTTPClient not working

I have an Arduino with an Ethernet shield.
I have the httpclient library, and I am trying to run the PachubeClient example.
When I compile, it gives me many errors:
PachubeClient.cpp:25:25: error: Credentials.h: No such file or directory
PachubeClient.cpp: In function 'void setup()':
PachubeClient:47: error: 'ssid' was not declared in this scope
PachubeClient:47: error: 'passphrase' was not declared in this scope
PachubeClient:55: error: a function-definition is not allowed here before '{' token
PachubeClient:95: error: expected `}' at end of input
Why?
I haven't played around with the Arduino development environment at all but that error message means you're either missing the Credentials.h file or the compiler doesn't know where to find it. Verify that the file exists and then check your compiler settings to make sure that you're passing it the path to the header files.