### Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

### Messages - Alex

Pages: 
1
##### ActiveX / Re: Is it possible to unselect a state ?
« on: August 04, 2014, 17:23:36  »
Thank you works perfectly !

2
##### ActiveX / Is it possible to unselect a state ?
« on: July 29, 2014, 16:03:15  »
Hi,

I have entered evidence for a discrete chance node with the simple function SelectState() and then propagated it through the network with the function Propagate(). I wondered if it there is a function that would unselect the state ?

Thanks.

3
##### ActiveX / How to manipulate posterior marginals ?
« on: July 14, 2014, 11:29:04  »
Hello,

I would like to manipulate posterior marginals of discrete chance nodes, e.g. node.Belief(x). But the access of this method is only for reading purpose whereas I would need one to be for writing also. Is there a way of doing so or to circumvent it ?

4
##### ActiveX / Re: Using invoke function in Matlab
« on: July 10, 2014, 10:48:28  »
You cannot set the subtype to "boolean" unless the node has exactly two states.  In other words, you must first set the number of states for the node.

set(node,'NumberOfStates',2);

just before

set(node,'SubType','hSubtypeBoolean');

works perfectly.

5
##### ActiveX / Using invoke function in Matlab
« on: July 08, 2014, 17:39:18  »
Hi,

I am using the invoke function in Matlab to handle the objects and their methods in Matlab. For example I have the following code to create a discrete labeled node:

function [ node ] = invokeDiscreteNodeLabeled(LabelCollection,domain,nodename)
%   LabelCollection is a Matlab cell containing the labels for the states
%   of the node
%   domain is the domain of the BN we consider
%   nodename is the name of the node

nstates=length(LabelCollection);
node=invoke(domain,'GetNewNode','hCategoryChance','hKindDiscrete');
set(node,'Name',nodename);
set(node,'Label',nodename);
set(node,'SubType','hSubtypeLabel');
set(node,'NumberOfStates',nstates);
for i=1:nstates
set(node,'StateLabel',i-1,LabelCollection{i});
end

end

The above code works perfectly but when I try to do the same to create a boolean node I get the following error

Error using Interface.HUGIN_API_ActiveX_Server_7.3.Node/set
Invoke Error, Dispatch Exception:
Source: HAPI
Description: An API function was called with an invalid argument (e.g., a NULL object was passed to a
function that expects a non-NULL argument).

Error in invokeDiscreteBooleanNode (line 7)
set(node,'SubType','hSubtypeBoolean');

The code for the boolean node is the following:

function [ node ] = invokeDiscreteBooleanNode(domain,nodename)
%invokeDiscreteBooleanNode Create a boolean node

node=invoke(domain,'GetNewNode','hCategoryChance','hKindDiscrete');
set(node,'Name',nodename);
set(node,'Label',nodename);
set(node,'SubType','hSubtypeBoolean');

end