help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Matrix manipulation


From: Nicholas Jankowski
Subject: Re: Matrix manipulation
Date: Thu, 21 Jun 2012 15:51:45 -0400

On Thu, Jun 21, 2012 at 3:49 PM, Knof <address@hidden> wrote:
>> Could you give an example of the code you are using?
>>
>> What do you do with this matrix, what do you get, and what do you expect?
>
>
> Matrix looks like this (first number marks the row number and that is what I
> am trying to preserve):
> 251 70.196 69.02 26.275
> 252 83.529 51.765 36.471
> 253 10.98 53.333 38.824
> 254 4.3137 69.804 20.392
> 255 15.294 98.824 57.255
>
> The project I am working on is transforming colors between different color
> spaces.
> First step is really simple and only requires me to divide columns two to
> four by 100.
>
> This is my code:
>
>         RGB=dlmread("/Users/Knof/Desktop/Matrix.txt");
>
>         #Size of matrix
>         b=size(RGB);
>
>         #Matrix length
>         v=b(1,1);
>
>         #Divide by 100
>         for i=1:v
>                 value(i,2:4)=(RGB(i,2:4)) /100;
>          end
>
> Columns two to four are divided correctly but first column just comes out as
> zeros in every line.
> ________________________________
> View this message in context: Re: Matrix manipulation
>
> Sent from the Octave - General mailing list archive at Nabble.com.
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave
>

In your for loop you never assign anything to the first column of value.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]