how do i correct a Vector Function indices compatibility Error?

9 Ansichten (letzte 30 Tage)
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

Akzeptierte Antwort

Matt J
Matt J am 15 Aug. 2021
Did you mean,
for i = 1:n
F(i)= t(i);
end

Weitere Antworten (0)

Kategorien

Mehr zu Shifting and Sorting Matrices finden Sie in Help Center und File Exchange

Produkte


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by