# Resolution exercise Octave Classic List Threaded 5 messages Open this post in threaded view
|

## Resolution exercise Octave

 Hello I am trying to solve an exercise on Octave and would like some help. I have a matrix A (10x5) with numbers from 1 to 80 random. From this matrix, 5 numbers are drawn, forming matrix B (1x5). I need to generate another matrix (10x5), where the numbers in matrix B are equal to A returns the value 1 and if different, returns the value 0. How can I do this? Thank you! -- Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
Open this post in threaded view
|

## Re: Resolution exercise Octave

 I think that a couple of "for" loops are enough.Check each element and place there 0 or 1.HTH,SamueleOn Mon, Apr 20, 2020 at 10:18 AM Simone <[hidden email]> wrote:Hello I am trying to solve an exercise on Octave and would like some help. I have a matrix A (10x5) with numbers from 1 to 80 random. From this matrix, 5 numbers are drawn, forming matrix B (1x5). I need to generate another matrix (10x5), where the numbers in matrix B are equal to A returns the value 1 and if different, returns the value 0. How can I do this? Thank you! -- Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
Open this post in threaded view
|

## Re: Resolution exercise Octave

 In reply to this post by Simone On Mon, Apr 20, 2020 at 4:18 AM Simone <[hidden email]> wrote:Hello I am trying to solve an exercise on Octave and would like some help. I have a matrix A (10x5) with numbers from 1 to 80 random. From this matrix, 5 numbers are drawn, forming matrix B (1x5). I need to generate another matrix (10x5), where the numbers in matrix B are equal to A returns the value 1 and if different, returns the value 0. How can I do this? Thank you! -- Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html Try reading this page:https://octave.org/doc/v4.2.1/Logical-Values.html-- DAS 