Delete equal elements in an array

Signal acquisition, processing and output
Ответить
pescecannuccia
beginner
beginner
Сообщения: 24
Зарегистрирован: 28 янв 2013, 14:47
Версия LabVIEW: 2012
Контактная информация:

Delete equal elements in an array

Сообщение pescecannuccia »

Hello to everyone,
is there anyone that can explain me how I can delete one of two (or plus) equal elements from an array, that is make sure that there are no equal elements in the array?
My code runs and doesn't run ( some of the equal elements are deleted and others not) and I don't understand why.. Can you help me?
Вложения
code.png
Аватара пользователя
mzu2006

Professionalism Tutorials Black
doctor
doctor
Сообщения: 2456
Зарегистрирован: 16 авг 2008, 02:12
Награды: 3
Версия LabVIEW: 7.1 10 11 12
Откуда: St-Petersburg (RU), Phila, Boston, Washington DC
Контактная информация:

Re: Delete equal elements in an array

Сообщение mzu2006 »

There is an OpenG VI - remove duplicates from 1D array. It should work just fine.
Speaking about your code, you need either 2 loops, or something else that can substitute a loop (like search 1D array function)
pescecannuccia
beginner
beginner
Сообщения: 24
Зарегистрирован: 28 янв 2013, 14:47
Версия LabVIEW: 2012
Контактная информация:

Re: Delete equal elements in an array

Сообщение pescecannuccia »

I don't understand; what is an openG VI?
Аватара пользователя
mzu2006

Professionalism Tutorials Black
doctor
doctor
Сообщения: 2456
Зарегистрирован: 16 авг 2008, 02:12
Награды: 3
Версия LabVIEW: 7.1 10 11 12
Откуда: St-Petersburg (RU), Phila, Boston, Washington DC
Контактная информация:

Re: Delete equal elements in an array

Сообщение mzu2006 »

pescecannuccia
beginner
beginner
Сообщения: 24
Зарегистрирован: 28 янв 2013, 14:47
Версия LabVIEW: 2012
Контактная информация:

Re: Delete equal elements in an array

Сообщение pescecannuccia »

This is how i solved the issue, if the initial array is sorted in ascending order. What do you think about it?
The Vi that you suggested me, in the openG library, runs as well as my solution...
Вложения
Delete duplicates from an 1D array.vi
(16.32 КБ) 443 скачивания
Аватара пользователя
mzu2006

Professionalism Tutorials Black
doctor
doctor
Сообщения: 2456
Зарегистрирован: 16 авг 2008, 02:12
Награды: 3
Версия LabVIEW: 7.1 10 11 12
Откуда: St-Petersburg (RU), Phila, Boston, Washington DC
Контактная информация:

Re: Delete equal elements in an array

Сообщение mzu2006 »

It does not work. Try 1 2 3 4 5 3, your solution will not delete 2 3s.
pescecannuccia
beginner
beginner
Сообщения: 24
Зарегистрирован: 28 янв 2013, 14:47
Версия LabVIEW: 2012
Контактная информация:

Re: Delete equal elements in an array

Сообщение pescecannuccia »

Yes, because, as i wrote the array must be sorted in ascending order.
I've another question for you.
I don't understand why, at the end of the for loop, is the output array empty? Where do i do wrong?
Another time, thanks for youur help..
Вложения
21.png
Ответить
  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Signal processing»