Hi all,(adsbygoogle = window.adsbygoogle || []).push({});

Im having a problem with the for loop. Any help would be great!!

The code is simple,

x = -3:0.5:3;

For i = x

q(i) = i^2;

end

q

The error seems to be the negative index in the statement of the for loop.

Hope this is clear. Thanks!!

**Physics Forums | Science Articles, Homework Help, Discussion**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# For loop problem

Loading...

Similar Threads for loop problem |
---|

Mathematica Looping through vectorized functions for a piecewise solution |

Mathematica While Loop in Mathematica |

MATLAB Does anyone had this plotting problem with MATLAB? |

Mathematica Solve Perturbation problem with mathematica |

**Physics Forums | Science Articles, Homework Help, Discussion**