Multiply Constant Array by Another Cell Array
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Kareem Elgindy
el 9 de En. de 2023
Respondida: Stephen23
el 9 de En. de 2023
How to multiply each element of [2 3] by {(1:3)';(-1:2)'} so that the output is {[2,4,6]';[-3,0,3,6]'}?
0 comentarios
Respuesta aceptada
Stephen23
el 9 de En. de 2023
A = {(1:3).';(-1:2).'};
B = [2,3];
C = cellfun(@times,A,num2cell(B(:)), 'uni',0)
C{:}
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Multidimensional Arrays en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!