could anyone help me to solve the issue

2 次查看(过去 30 天)
A=[2.1 2.2 2.3 2.4 2.5 2.6]
B=[0.49 0.48 0.47 0.47 0.47 0.47]
I want to have the desired result
A=[2.1 2.2 2.3 2.3 2.3 2.3]
As B has the same values starting from third place, A needs to have the value 2.3 at the same third place and it should be continued until the end.

采纳的回答

madhan ravi
madhan ravi 2019-9-13
编辑:madhan ravi 2019-9-13
[~,~,c] = unique(B,'stable');
A = A(c)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by