Auto update row index to match the variable length

조회 수: 1 (최근 30일)
Sankalp Garud
Sankalp Garud 2021년 9월 27일
답변: Konrad 2021년 9월 27일
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에서 Get Started with Simulink에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by