Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'For loop' topicStudent Support Forum > General > Archives > "For loop"

Help | Reply To Topic
Author Comment/Response
Antony
09/20/09 05:40am

Hi, i am having some problem with the For loop... this is my programme
Input:M3a = M3b = M3[[1]]

Output:{{-3, 4, 5}, {-2, 2, -3}, {0, 2, -1}}

Input:M3a[[1]] = M3b[[2]];
M3a[[2]] = M3b[[3]];
M3a[[3]] = M3b[[1]];
M3a

Output:{{-2, 2, -3}, {0, 2, -1}, {-3, 4, 5}}

Input:For[i = 1,
Abs[M3a[[i, i]]] >= (Abs[M3a[[i, 1]]] + Abs[M3a[[i, 2]]] +
Abs[M3a[[i, 3]]]); i <= 3, i++, Print[True]]

Input:For[i = 1, Abs[M3a[[i, i]]] >= Sum[Abs[M3a[[i, j]]], {j, 1, 3}];
i <= 3, i++, Print[True]]

Both the For loop give me 3 trues however i am expecting false for all of them. Can someone help to point out the miatake or error in my for loop. Thanks.

URL: ,
Help | Reply To Topic