Matlab Basic Function - function

I'm trying to read some matlab code, but I'm new to it. How do I figure out what the input parameters are?
function [shortly, longly] = lyapunov(signal,timestep,FreqSamp,segmentapproach, duratsegmen, dodivergence)
//lots of code under here but I couldn't find out where signal, timestep, etc come from.

Read the help for lyapunov. It will tell you that information.

Related

Basic Python - How to run everything inside this function exepct one

Hello, I think my question is fairly simple so I don't have to write in code format here, I just want to know some intermediates coding practice in blender python,
i just want to know how can i run call this function and then leave out and not running just one line?
For example: self.Grobs = False,
I want to keep this true
I sort of guess the function parenthesis can help in this?
def cul_off_all():
thank you in advance!
Cheers!

Function Series in Sympy

I am quite new to sympy. I need to work with Function Series, something of the kind,
Sum(f_i(x), (i,0,n))
Of course this could be written like Sum(f(x,i),(i,0,n)) having defined i and n as integer.
Anyway, I am not finding any online resource to learn how to work with this conveniently, write the series, and then make operations like derivatives,...
Could anybody recommend a resource, or explain how she/he is writing it in sympy.
Thanks in advance!

mlr support for xgb.create.features - how to use?

There is a function in the r mlr package that lists all the methods it supports for a given learner, which I have used once but cannot find again. I do recall that xgboost's xgb.create.feature was definitely on the included list, but I cannot find any docs on how to use it from within mlr. Does anyone know how to do this? (And if anyone can remember the name of the mlr search function for implemented learner methods that would also be much appreciated.)
xgb.create.features is a function from xgboost not mlr.
If you want to use the function, you can access the learner model directly and call the function.
library(mlr)
library(xgboost)
mod = train(makeLearner("classif.xgboost"), iris.task)
iris.dc = data.matrix(getTaskData(iris.task, target.extra = TRUE)$data)
xgboost::xgb.create.features(mod$learner.model, iris.dc)
Not all methods of learners are directly supported from mlr side.

Lua, table containing a function

I'm using the World of warcraft API. And I want to find an EventMessageFilter. I can do so by calling
ChatFrame_GetMessageEventFilters("event")
And to do this I have to pass a chat event, in my case CHAT_MSG_WHISPER_INFORM.
So according to the API located over at
http://wowprogramming.com/docs/api/ChatFrame_GetMessageEventFilters
This function will return a table. So I named the table and tried to print its content with this code
local myNewTable = filterTable = ChatFrame_GetMessageEventFilters("CHAT_MSG_WHISPER_INFORM")
for i in pairs(myNewTable) do
print(asd[i])
end
And this then prints out something like
function: 00000312498vn27842934c4
I have checked with
type(asd[i])
and it really is a function. But how can I get the content of it? How do I handle it?
I want to find an EventMessageFilter
Can you elaborate? Whose filter are you looking for and what do you intend to do with it?
it really is a function.
That's what this API does: returns a list of functions that are registered as filters for a particular message type (via ChatFrame_AddMessageEventFilter).
But how can I get the content of it?
You can't. The WoW API doesn't offer you any facilities for decompiling functions.
If your intention is to filter chat messages yourself, you don't need to call this function at all. Just call ChatFrame_AddMessageEventFilter to add your filter.
So I managed to solve my problem by removing to current filters that have been put in place by another addon and then just add my own filter. As Mud pointed out. GMEF was supposed to return functions. I now see how this makes sense. But now I have made the code to remove the functions. If you want to re-add them later on, just store them in a variable until you are done but I won't include this in my answer. I also feel like my answer is kinda half off-topic ish. But to answer my own question. It is supposed to return functions and you can't see the contents of these functions. This is the code I used to remove the functions that were put in there by another addon.
function rekkFilters()
local myFilters = ChatFrame_GetMessageEventFilters("CHAT_MSG_WHISPER_INFORM")
for i in pairs(myFilters) do
ChatFrame_RemoveMessageEventFilter("CHAT_MSG_WHISPER_INFORM", myFilters[i])
end
end
local myFilters = ChatFrame_GetMessageEventFilters("CHAT_MSG_WHISPER_INFORM")
rekkFilters()
local myFilters = ChatFrame_GetMessageEventFilters("CHAT_MSG_WHISPER_INFORM")
if myFilters[1] ~= nil then
rekkFilters()
end

Matlab ode solver using the time in a function for 'value' in events

I've searched extensively, and thought I wouldn't be the only one having this problem, but it seems to look like I am.
I am solving an ode via ode15s (my problem can be stiff) and I use the 'Events' option to find my point of interest.
The problem is: the equation that I use in 'value' is depending (among other things) on the specific time (so value = f(t,y,y'), and I cannot find a way of passing the current time to this function, only the y vector is available.
Anyone has any ideas?
Thanks in advance and all the enjoy the rest of your holidays!
Sorry, made a really stupid error (used , instead of ;)...
You can just use the t argument as long as you set it in your #odefunction(t,y) as well as your #events(t,y).