这可能是一个愚蠢的问题,但我不太擅长 matlab,而且我不知道如何从用户那里获得输入。我正在编写应该n
从用户那里获取节点及其坐标的代码,然后找到哈密顿路径。这是我的想法,请告诉我我错在哪里。
n=input('\nPlease enter the number of nodes: \n')
for i:1:n
pos[]=input('\nPlease enter their coordinates. \n')
end
x=pos(:,1);
y=pos(:,2);
提前致谢。