Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How introduce inputs in a @interact sage program

Concretely, how tranlate the following MATLAB program to SAGE:

n=input('number of vertices n= '); m=input('number of edges m= '); disp('write weighted edges as [v1 v2 w12]'); for i=1:m E(i,:)=input(['arco ',num2str(i), '= ']); end disp(E)

click to hide/show revision 2
No.2 Revision

updated 2012-01-17 04:34:33 -0500

kcrisman gravatar image

How introduce inputs in a @interact sage program

Concretely, how tranlate the following MATLAB program to SAGE:

n=input('number of vertices n= ');
m=input('number of edges m= ');
disp('write weighted edges as [v1 v2 w12]');
for i=1:m
    E(i,:)=input(['arco ',num2str(i), '= ']);
end
disp(E)

disp(E)