Hello all,
If I want to create a matrix of for example 9.5 with a specific size i.e. [9.5 9.5 .... 9.5], what should I do?

2 comentarios

Ashok jat
Ashok jat el 18 de Mayo de 2019
x=ones(1,8);
y=9.5*x
Walter Roberson
Walter Roberson el 19 de Mayo de 2019
This is the same as Fangjun Jiang's solution.

Iniciar sesión para comentar.

 Respuesta aceptada

Fangjun Jiang
Fangjun Jiang el 5 de Sept. de 2011

1 voto

A=9.5*ones(3,4)

Más respuestas (4)

bym
bym el 5 de Sept. de 2011

0 votos

m = 9.5*ones(1,15)
Walter Roberson
Walter Roberson el 5 de Sept. de 2011

0 votos

A = repmat(9.5,3,4);
or
A(1:3,1:4) = 9.5;
Bao Le
Bao Le el 5 de Dic. de 2019

0 votos

x = 9.5.*ones(2,5)
Alejandro Ayala
Alejandro Ayala el 5 de Dic. de 2019

0 votos

x = 9.5.*ones(2,5)

Categorías

Productos

Etiquetas

Preguntada:

el 5 de Sept. de 2011

Comentada:

el 5 de Dic. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by