how do i correct a Vector Function indices compatibility Error?

조회 수: 12 (최근 30일)
Hi, i keep getting this error "Unable to perform assignment because the indices on the left side are not compatible
with the size of the right side" when i run the following, how can i fix it?
t = 0:0.1:10;
n = length(t);
for i = 1:n
F(i)= t
end

채택된 답변

Matt J
Matt J 2021년 8월 15일
Did you mean,
for i = 1:n
F(i)= t(i);
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by