Matlab - Mov torre en matlab?

 
Vista:

Mov torre en matlab?

Publicado por Charmander (1 intervención) el 20/07/2012 01:25:15
Tengo que hacer correr una torre en matlab pero no se me ocurre como, tengo la idea del mov del arfil pero este ademas no me corre en matlab cuando lo ejecuto, me tira error en la linea 38



B=('B');
N=('N');
tablero=[];
%LLENAMOS EL ARREGLO
for i=1:8
for j=1:8
if mod(i,2)==0
if mod(j,2)==0
tablero(i,j)= B;
else tablero(i,j)=N;
end
else if mod(j,2)==0
tablero(i,j)=N;
else tablero(i,j)=B;
end
end
end
end
x=input('Ingrese fila: ');
y=input('Ingrese columna: ');
z=x;
m=y;
n=y;
r=y;
p=y;
%ENCONTRAMOS LAS POSICIONES DEL ALFIL
for k=x:7
if(m+1=1) tablero(k+1,n-1)='*';
n=n-1;
end
end
l=z; while l>1
if r-1>=1 tablero(l-1,r-1)='*';
r=r-1;

end
if (p+1)
for i=1:e
y=((-1)^i)*(x^i)*(1/((1+x)^((2*i)-1)))*((2*i)-1)*z;
end
end
y=x+y;
disp(y);


y no se donde estara el error, si me ayudan estaria muy agradecido..
saludos
la idea es imprimir un tablero de ajedrez, y simbolizar el mov de las piezas con *.
Se debe ocupar el ciclo for.. eso
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder