[Help]+Matrix Operation

1 visualización (últimos 30 días)
sheng
sheng el 13 de Jun. de 2012
Respondida: Sweety el 9 de Mayo de 2024
I found a program from internet, the following is the part code:
t=0:1/1e3:0.999;
a=randint(1,10);
b=ceil(10*t+0.01);
s=a(b);   
% I do not know what a(b) means. a is 1*10 matrix,b is 1*1000 matrix.
Who can tell me, thank u!

Respuestas (2)

Nirmal
Nirmal el 13 de Jun. de 2012
b is being used as an index.
t is an array with elements incrementing my 0.999, which means b is also an array. Now elements of b is used as an index to construct s.

Sweety
Sweety el 9 de Mayo de 2024
<<a=[1 2 3;1 2 3]

Categorías

Más información sobre Multidimensional Arrays 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