Matlab newbie here, so be gentle.
I am trying to port some Matlab code to C/C++ and am struggling to understand some of the syntax.
In particular, the following code segment eludes me:
if i0<i1 k=[i1 i i0];elseif i0>i k=[i0 i1 i];elseif i1<i k=[i i0 i1];endv=1:length(s);v(k(1))=[];v(k(2))=[];v(k(3))=[]; for k=1:length(v) px=s(v(k),1); py=s(v(k),2);end;
As I understand it, the first if-then block creates k as a one row, three column matrix. I am simply lost by the next code block. Any help in understanding what it means (especially in C/C++ form) appreciated.
Thanks
Best Answer