取消
显示结果 
搜索替代 
您的意思是: 

Replace Array element based on certain conditions

已解决!
转到解答

Hello All,

 

Please help me if anyone have nice idea.

 

I want to replace Array elements based on certain conditions.

As per attached Sample,

I have fixed character Array & Some Random values with Array Size.

Here, I need to check Random char with fixed Array. If char is not matching then I need to replace that index value with “NaN”. Once it is matching for one time then next time I need to display Run time value for that particular index.

Munna
0 项奖励
1 条消息(共 11 条)
4,823 次查看

Maybe i misunderstood, but it can give you some ideas.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 项奖励
2 条消息(共 11 条)
4,792 次查看

Maybe i misunderstood, but it can give you some ideas.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
下载全部
0 项奖励
3 条消息(共 11 条)
4,792 次查看

Dear Yamaeda,

 

Thanks for your reply.

 

your attached VI is not mathching with my requirement. If 1st time Index is matching then next time we should not display NaN (eventhough its not mathching for next time). I have to display NaN until that index is not matching.

after Matching I need to display Runtime Value....

 

 

Munna
0 项奖励
4 条消息(共 11 条)
4,765 次查看

Ok, so your program is working as it should? Then what's the question? 🙂

What problem are you trying to solve?

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 项奖励
5 条消息(共 11 条)
4,759 次查看

Sorry. I'm thinking to minimize my code.

 

Just waiting for better solution.

Munna
0 项奖励
6 条消息(共 11 条)
4,752 次查看
解答
接受人 Munna232

Yes, you have way too much code for such a simple problem. Also, your random character generator is flawed, because A and Z will only occur at half the probability of the other characters.

 

Here's a quick draft how it could be done with less code (LV 2012). Modify as needed. I am sure more simplifications are possible....

 

 

下载全部
0 项奖励
7 条消息(共 11 条)
4,742 次查看

Dear Altenbach,

 

Thanks for your nice idea.

 

I have made minor changes to your code. Because sometimes i need to check Same character 2-3 times from Fixed array.

I think, once all index values are matching then no need to check.

 

NaN3.png

 

 

 

Munna
0 项奖励
8 条消息(共 11 条)
4,722 次查看

You can just do a "AND array elements" on the boolean array for the outer case structure. No need to convert, sum, compare sizes, etc.

0 项奖励
9 条消息(共 11 条)
4,707 次查看

Yes.. Thank you altenbach 🙂

Munna
0 项奖励
10 条消息(共 11 条)
4,705 次查看