Vectorization MATLAB sum equation snippet -
i new matlab, , understand how can vectorize below snippet, or how can efficiently:
sum=0; = 1:50 sum=sum+i; end
you can use sum native function:
total = sum(1:50);
i new matlab, , understand how can vectorize below snippet, or how can efficiently:
sum=0; = 1:50 sum=sum+i; end
you can use sum native function:
total = sum(1:50);
Comments
Post a Comment