[Scilab-users] for-loop -> vectorisation

haasejos haasejos at web.de
Sun Nov 25 18:16:35 CET 2012


hallo,
I want to calculate the algebraic sum of all entries in each columns of a
matrix, like it is done in this example:

clear; clc; xdel;

m = [1 2 3;...
	4 5 6;...
	7 8 9];
a = zeros(1:length(m(1,:));
for i = 1 : length(m(1,:));
a(i) = sum(m(:,i));
end;
disp(a);

Can this be done by vectorisation the for-loop?

thank you!
Josef



--
View this message in context: http://mailinglists.scilab.org/for-loop-vectorisation-tp4025325.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.



More information about the users mailing list