I'm running a for loop which gives an output 'x'. This output can be a vector of size (n,1). However I want to assign d=0 when n is larger than 1?
Something like this:
if x == size(1,1) d = double(Residual_d(x))else if x ~= size(1,1) d = 0end
, where Residual_d is a previous symbolic function which outputs 'x'.
Thanks in advance!
However, the above does not work as the loop jumps straight through the if statement to the elseif statement.
Best Answer