How can i delate the same values in a vector ?

1 次查看(过去 30 天)
Hi
To find the zeros of the following equation, i have done the following program but sometimes it displays a repeated solution. So i want to do a program that delate the same solutions to obtain a vector that content the different solutions.
f = @(x) cos(x) * cosh(x) + 1;
for i= 1:40
k(i)= fzero (f, i)
end

回答(1 个)

the cyclist
the cyclist 2017-1-20
Do you mean you want
unique_k = unique(k)
?
  9 个评论
Stephen23
Stephen23 2017-1-21
You could download John D'Errico's excellent FEX submssion consolidator.

请先登录,再进行评论。

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by