MATLAB 帮助中心
Copy factor graph
Since R2026a
copyfg = copy(fg)
copyfg = copy(fg) creates a deep copy of the specified factor graph with the same properties.
copyfg
fg
example
collapse all
Create factor graph and add factors to the graph.
fg = factorGraph; ids = generateNodeID(fg,5,"factorTwoPoseSE2"); poseFactors = factorTwoPoseSE2(ids,Measurement=repmat([1 0 0],5,1)); addFactor(fg,poseFactors);
Optimize factor graph and get the node states.
optimize(fg); stateFG = nodeState(fg,unique(ids))
stateFG = 6×3 -2.5000 0 0 -1.5000 0 0 -0.5000 0 0 0.5000 0 0 1.5000 0 0 2.5000 0 0
Create a deep copy of the factor graph and display the node states of the factor graph copy.
fgCopy = copy(fg); stateFGCopy = nodeState(fg,unique(ids))
stateFGCopy = 6×3 -2.5000 0 0 -1.5000 0 0 -0.5000 0 0 0.5000 0 0 1.5000 0 0 2.5000 0 0
factorGraph
Factor graph, specified as a factorGraph object.
Factor graph, returned as a factorGraph object. This copies all property values, node states, factors, and calculated covariances from fg.
expand all
Introduced in R2026a
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处