In an assignment A(I) = B, the number of elements in B and I must be the same, error.
Show older comments
x =
4
5
6
7
8 %5x1
X =
1
2
3
4
5
6 %6x1
q=6;
for i=1:q
dk(i)=x-X(i)
end
%it gives me the error.
%in this statement, I wanna create this situation,
dk(1)=x-X(1)
dk(2)=x-X(2)
dk(3)=x-X(3)
dk(4)=x-X(4)
dk(5)=x-X(5)
dk(6)=x-X(6)
What kind of loop I need to create these "dk".
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!