Auto update row index to match the variable length

3 次查看(过去 30 天)
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

回答(1 个)

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

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by