I am a total green hand on Matlab stuff and I have a question about how I can call a MATLAB function in Thingspeak Matlab Analysis?
For example, I have a Matlab function as below:
Function [ data1, data2, parameter1, parameter2] = calculate_something(parameter1, parameter2, parameter3)
Is there a way that I can call this function in Thingspeak Matlab Analysis's Matlab code?
This is very similar to call "ThingspeakRead" function in the current Matlab Analysis panel window. I am wondering if I can call a customized function in the panel window.
Thanks a lot for any comments in community.
At present, you will not be able to call custom functions from either the MATLAB Analysis App or the MATLAB Visualization App. Both the Apps only allow a MATLAB script to be written and this script can only call functions already defined in MATLAB. We will consider this capability for a future release.
As a workaround, you can move the logic in the 'calculate_something' function into each MATLAB Analysis/Visualization App that requires it, as a script.
I am also facing problem using if function. I am getting current time using clock function. Then I want to do some check on time and based on the time I want to feed data to new channel. It appears if function does not work at all.
Update: I did not write end statement. It works.
@Adarsh_Murthy - if you are considering feature requests for future releases can I suggest passing URL parameters through to the matlab environment? This would allow more generic and re-usable code since you could specify a channel or field number in the URL and have matlab process it rather than have to hard-wire it into each block.
Most Users Ever Online: 114
Currently Browsing this Page:
Guest Posters: 1
Administrators: Hans, lee