assign empty vector to an element of a vector in a for loop
8 ビュー (過去 30 日間)
I created a 'for' loop with 'solve'
At some points, the 'solve' function returns '0×1 empty double column vector' (which is correct).
But then, Matlab returns an error 'Unable to perform assignment because the left and right sides have a different number of elements.' because of the empty vector.
I understood the problem but is there any way to assign that empty vector to an element of another vector?
I would like to have the vector in the form like r=[1, 3 , 4 ,, , ,..., 5, 7,9]