Is it possible to get avarge gnd density per grain?

98 views
Skip to first unread message

huihu...@hotmail.com

unread,
Feb 13, 2019, 10:55:10 AM2/13/19
to MTEX

Hello Sir,

I would like to calculate avarge gnd density per grain. How can I perform this?

For example, how to get get avarge GND density per grain in gnd demo which is put on  the website "http://mtex-toolbox.github.io/files/doc/GND_demo.html" ?

Regards,
Huihui


Rüdiger Kilian

unread,
Feb 13, 2019, 11:44:29 AM2/13/19
to mtex...@googlegroups.com
Hi,
in general, one should be able to average ny property over a grains using accumarray e.g. if gnd exists for each ebsd point:

[~,~,eindex] = unique(ebsd.grainId);
grain_averaged_gnd = accumarray(eindex,gnd,[],@nanmean);

Hope that works.

Cheers,
Rüdiger
________________________________________
From: mtex...@googlegroups.com <mtex...@googlegroups.com> on behalf of huihu...@hotmail.com <huihu...@hotmail.com>
Sent: Wednesday, February 13, 2019 4:55:10 PM
To: MTEX
Subject: {MTEX} Is it possible to get avarge gnd density per grain?
--
If you want to reduce the number of emails you get through this forum login to https://groups.google.com/forum/?fromgroups=#!forum/mtexmail, click "My membership" and select "Don't send me email updates". You can still get emails on selected topics by staring them.
---
You received this message because you are subscribed to the Google Groups "MTEX" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mtexmail+u...@googlegroups.com<mailto:mtexmail+u...@googlegroups.com>.
Visit this group at https://groups.google.com/group/mtexmail.
For more options, visit https://groups.google.com/d/optout.

huihu...@hotmail.com

unread,
Feb 14, 2019, 10:36:42 AM2/14/19
to MTEX
Dear Rüdger,
  
Thank you for  your kind help!
 I tried the code, but it didnt work. some errors happen, as follows:

>> [~,~,eindex] = unique(ebsd.grainId); 
grain_averaged_gnd = accumarray(eindex,gnd,[],@nanmean); 
Error using accumarray
Second input VAL must be a vector with one element for each row in SUBS, or a scalar.
 Thank you very much!

 Huihui 
 

Rüdiger Kilian

unread,
Feb 14, 2019, 12:06:26 PM2/14/19
to mtex...@googlegroups.com
Hi, so what is your variable gnd?
Cheers,
Rüdiger
________________________________________
From: mtex...@googlegroups.com <mtex...@googlegroups.com> on behalf of huihu...@hotmail.com <huihu...@hotmail.com>
Sent: Thursday, February 14, 2019 4:36:42 PM
To: MTEX
Subject: Re: {MTEX} Is it possible to get avarge gnd density per grain?
Reply all
Reply to author
Forward
0 new messages