MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Problem in generating a DO cycle (mathematica 6.0)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg95342] Re: Problem in generating a DO cycle (mathematica 6.0)
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Fri, 16 Jan 2009 06:08:01 -0500 (EST)
  • References: <gkn5jk$ihb$1@smc.vnet.net>

Hi,

try

gv = Flatten[
    ImageData[Import["http://sipi.usc.edu/database/misc/5.1.09.tiff";]],
     1];

or in your case

gv = Flatten[
    ImageData[Import["p6a.bmp"]],
     1];

with Mathematica 7 and with Mathematica 6

gv = Flatten[
   Import["http://sipi.usc.edu/database/misc/5.1.09.tiff"][[1, 1]], 1]

or

gv = Flatten[
   Import["p6a.bmp"][[1, 1]], 1]

BTW: Your code is awfully nonsense and you should really read
the manual.

Regards
   Jens


Valeria Volpe wrote:
> Dear all I have a problem in generating a DO cycle (mathematica 6.0).
> 
> Through these commands I acquire a bitmap image from a my folder and create
> a "Graylevels" file:
> 
> Quit;
> SetDirectory[ "C:\\Users\\...\\Dati\\\Bitmap\\\xxx"];
> nome = "p6a.bmp";
> Import[nome, "ImageSize"];
> row = ToExpression[Import[nome, "ImageSize"]][[1]];
> col = ToExpression[Import[nome, "ImageSize"]][[2]];
> vmax = row*col;
> gv = Array[f, vmax];
> gl = Import[nome, "GrayLevels"];
> 
> 
> at this point I have a matrix with all graylevels.
> 
> Now my problem is to create a two DO cycle (one for rows and one for
> columns) which allow me to generate an array (gv) whose elements are the
> product row x column of the matrix:
> 
> gv[i] = gl [j,k]
> 
> where:
> {i,1,Vmax}
> {j,1,row}
> {k,1,col}
> 
> Can you pleasa herlp me to generate these Do Cycle?
> 
> Thanky
> Vale
> 
> 


  • Prev by Date: Taking LCM in a polynomial expression
  • Next by Date: Finding a sine wave
  • Previous by thread: Re: Problem in generating a DO cycle (mathematica 6.0)
  • Next by thread: Solving the Quintic: Correction to x^5 + 20 x + 32 == 0 root example