How change setting of a Valve?

Hi everybody,
Is it possible to change Valve setting that is an index of a curve in Matlab?
I use below code and I got error: “Error using epanet/setLinkInitialSetting (line 2202)
Input Error 202: function call contains illegal numeric value.”

x = d.getLinkInitialSetting
d.setLinkInitialSetting(x)

or

x = d.getLinkSettings
d.setLinkSettings(x)

Hi Kazem,
Is it possible to sent me your code? I can check your code and then try to answer your question as exactly.
Regards,
Alireza

I tried different ways, but it was always wrong. :sob::sob::sob::sob:

clc; clear; close all;      
d = epanet('Net2.inp');
d.BinUpdateClass;
index=1;
s=d.BinLinkValveSetting;
s(index)=4;
d.setBinLinkValvesParameters('setting',s);
v=d.getBinLinksInfo;
v.BinLinkValveSetting
v.BinLinkValveStatus

I am facing simillar issue. Can u help…?? or someone else. @alireza2032