Auto update row index to match the variable length

5 visualizaciones (últimos 30 días)
Sankalp Garud
Sankalp Garud el 27 de Sept. de 2021
Respondida: Konrad el 27 de Sept. de 2021
Hi there,
This should be a basic question. I am trying to create a matrix
b(:,k) = a
Does not work. While
b(1:52, k) = a
Works. Is there some syntax where I don't have to put in the exact range for the rows and it auto updates?
Sankalp

Respuestas (1)

Konrad
Konrad el 27 de Sept. de 2021
Hi
you can use
b(1:numel(a),k) = a
if k is scalar.
Best, K

Categorías

Más información sobre Data Types 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