Quantcast
Channel: MATLAB Central Newsreader Recent Posts
Viewing all articles
Browse latest Browse all 19628

Re: how to fix subscript indices must either be real positive integers or logicals?

$
0
0
"IceHaven" wrote in message <kvld4n$8sd$1@newscl01ah.mathworks.com>...
> "p v bhumireddi" wrote in message <kvlbcg$8cc$1@newscl01ah.mathworks.com>...
> > im new to matlab.im executing program and im getting repeatedly the above mentioned error
> > my code is
> > w=[2:5];
> > int=0;
> > for k=1:w
> > e(int)=[exp(i*k) exp(2*i*k)];
> > int=int+1;
> > end
> > can anyone help me.urgent
>
> can you explain what your script is trying to do? I'm running it in Matlab, and there's a couple of errors coming up. Namely, you're using "i" but not defining it, and your looping value is a range, which doesn't work at all.

I believe he is using i as MATLAB's sqrt(-1)

Viewing all articles
Browse latest Browse all 19628

Trending Articles