How to multiply elements of a matrix by a number

28 visualizaciones (últimos 30 días)
Rawan hamdi
Rawan hamdi el 8 de Abr. de 2013
Comentada: Image Analyst el 3 de Jul. de 2022
Hi, I'm having a matrix of size X= [280,307,191] and i want to restore the matrix such that the 3rd dimension of the matrix is multiplied by '12'
Thank you
  2 comentarios
Azzi Abdelmalek
Azzi Abdelmalek el 8 de Abr. de 2013
What do you mean?
Rawan hamdi
Rawan hamdi el 8 de Abr. de 2013
I have an image X of size 280x307x191 and i got the gradient to be A = gradient X (:,:,:) what i need to do is to multiply the gradient of the z dimension of the image by a constant eg. '12'

Iniciar sesión para comentar.

Respuestas (2)

Image Analyst
Image Analyst el 8 de Abr. de 2013
You misunderstood the discussion in your prior question. Anyway, to do what you're asking for here (which is not what you really want):
A = 12 * A;
Why? Because, of course, every voxel has a Z value. I bet you're confused now, so better go back to your prior question and figure out what you really want to do.

rimsha fazal
rimsha fazal el 3 de Jul. de 2022
Hi I have a case to multiply 2 by 2 matrix with a variable of 50000 elements. how can i do this?
w.*[Cm] it doesn't work.
  1 comentario
Image Analyst
Image Analyst el 3 de Jul. de 2022
If you want a matrix multiplication do
theProduct = w * Cm
% or
theProduct = Cm * w

Iniciar sesión para comentar.

Categorías

Más información sobre Resizing and Reshaping Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by