You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
how to assign weightage
    4 views (last 30 days)
  
       Show older comments
    
suppose i have a matrix x and the second row has values ranging from 0.2 to 102 and weightage has to be assigned to these depending on the mean. the values close to the mean should have highest weightage and progressively decrease as it goes farther.
20 Comments
  madhan ravi
      
      
 on 12 Nov 2018
				give an example and your desired output
  johnson saldanha
 on 12 Nov 2018
				the example is the same. the values ranging from 0.2 to 102 in randomn order. totally there are more than 1000 values. the highest is 102 and lowest is 102. the mean is 67. the weightage should be given to these values. the weightage should be highest for the values close to the mean. it is okay if the values are put in bins and weightage is given depending the bins. the output should be such that 60-70 should have highest weightage and decrease as it goes farther.
  johnson saldanha
 on 12 Nov 2018
				after this i need to find the time for which values are constant.
  johnson saldanha
 on 12 Nov 2018
				as there are many set of values where the values are constant, i need to give different weightage to each set
  Walter Roberson
      
      
 on 12 Nov 2018
				What is to be done with the first row of the matrix?
  johnson saldanha
 on 12 Nov 2018
				the weighing factor could be in terms of 0.1 to 0.9 where later i can multiplty the time for which the values are constant. i also need the time for which it is constant
  johnson saldanha
 on 12 Nov 2018
				the values start from the first row itself
  Walter Roberson
      
      
 on 12 Nov 2018
				The values start from the first row but you have only defined processing the second row. Should we just discard the first row?
  johnson saldanha
 on 12 Nov 2018
				my bad. im sorry. theres a correction in the question. it should be second column instead of second row
  johnson saldanha
 on 12 Nov 2018
				the operation is to be done on the second column only
  Walter Roberson
      
      
 on 12 Nov 2018
				Okay what should be done with the first column?
  johnson saldanha
 on 12 Nov 2018
				discard it. i mean we have to access only the second column. and the description given is for the second column. thank you
  johnson saldanha
 on 12 Nov 2018
				any updates?
  Walter Roberson
      
      
 on 12 Nov 2018
				sort() on abs(x-mean(x)) and take the second output of sort to tell you the order.
  johnson saldanha
 on 12 Nov 2018
				second output of sort as in? its a column matrix ryt
  Walter Roberson
      
      
 on 12 Nov 2018
				[sorted_distance, sort_order] = sort(abs(x-mean(x))) ;
  johnson saldanha
 on 12 Nov 2018
				im sorry. i havent understood how its related to my problem statement
  Walter Roberson
      
      
 on 12 Nov 2018
				You said that the values closest to the mean should have the highest weight . sorted_distance tells you exactly how far values are from the mean, arranged in increasing distance . sort_order tells you what the original order was. For example if the first entry of sorted_distance is 0.063 and the first entry of sort_order is 19 then that tells you that the entry that was closest to the mean was aa distance of 0.063 from the mean and that it was the 19th row in the original data that had that entry . 
Now it is up to you to decide how a particular distance from the mean shold be transformed into a weight . 
  johnson saldanha
 on 13 Nov 2018
				yeah got it. thank you
Answers (0)
See Also
Categories
				Find more on Creating and Concatenating Matrices in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)



