Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #7039 > unrolled thread

Re: 100 rows and 100 columns random matrix

Started by"Karamiarokhloo, M.P. (Mehdipasha)" <M.P.Karamiarokhloo@uu.nl>
First post2011-12-08 10:41 +0000
Last post2011-12-08 10:41 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: 100 rows and 100 columns random matrix "Karamiarokhloo, M.P. (Mehdipasha)" <M.P.Karamiarokhloo@uu.nl> - 2011-12-08 10:41 +0000

#7039 — Re: 100 rows and 100 columns random matrix

From"Karamiarokhloo, M.P. (Mehdipasha)" <M.P.Karamiarokhloo@uu.nl>
Date2011-12-08 10:41 +0000
SubjectRe: 100 rows and 100 columns random matrix
Message-ID<jbq48s$itb$1@smc.vnet.net>
Hi,
one way to do this is to re-define all the values smaller than 0.5 (<=0.5) as for example 0 and the values
larger than 0.5 (>0.5) as 1.Then you use the count function.
Here is an example:

In[40]:= data = {0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9} /. 
  x_ /; x <= 0.5 -> 0

Out[40]= {0, 0, 0, 0, 0, 0.6, 0.7, 0.8, 0.9}

In[41]:= Count[data, 0]

Out[41]= 5

I hope this will help.

P.Karami
________________________________________
From: Sahar Nazemi [nazemisahar@yahoo.com]
Sent: Wednesday, December 07, 2011 12:15 PM
Subject: 100 rows and 100 columns random matrix

Hello
I'm a student of geology who works with
Mathematica sofware .I'm learning it by myself recently.
I have a question and will appreciate if you
help me in this regard.
I have created a 100 rows and 100 columns random
matrix which its elements are between 0 to 1(for example it consists of
0.687,...).
Now I want to know how many of these elements
are in the range of "0 to 0.5" and how many are in the range of
"0.5 to 1".
I also use "Count" function as below
but it doesnt answer:
Count[a,{0,0.5}]
("a" is my random matrix).
Regards
Sahar Nazemi

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web