subtract number to matrix

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

subtract number to matrix

shivax
hi,
i want to subtract scalar to matrix(x,y)

it's possible to do it without use the loop?

example:

a=[3,4,5;5,6,7;6,7,8]

subtract 1

new A =[2,3,4;4,5,6;5,6,7]







--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: subtract number to matrix

Santiago Higuera-2
Have you tryed A-1?


El 07/09/18 a las 19:53, shivax escribió:

> hi,
> i want to subtract scalar to matrix(x,y)
>
> it's possible to do it without use the loop?
>
> example:
>
> a=[3,4,5;5,6,7;6,7,8]
>
> subtract 1
>
> new A =[2,3,4;4,5,6;5,6,7]
>
>
>
>
>
>
>
> --
> Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
>
>
>



Reply | Threaded
Open this post in threaded view
|

Re: subtract number to matrix

LucaLuca
Reply | Threaded
Open this post in threaded view
|

Re: subtract number to matrix

LucaLuca
i've solved


it's simple:  

Matrix+number






--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html