matlab found an internal error (please help)

1 view (last 30 days)
i keep getting this error whenever i import an excel file but out of the multiples that i import only two gave me this message here is my code
if true
% code
end
function Force = PlantearEquilibrio(Nod,PosX,PosY,Con,Rest,Load)
x = size(Nod);
y = x(1);
t = size(Con);
u = t(1);
cont = 0;
for e = 1:length(Rest)
for t = 1:2
Rest(e,t);
if Rest(e,t) ~= 0
cont = cont + 1;
end
end
end
matr = zeros(2*y,(u + cont));
fuerzas = zeros((u + cont),6);
w = 1;
while w < u +1
angulo = atan(((PosY(Con(w,2))-PosY(Con(w,1)))/(PosX(Con(w,2))-PosX(Con(w,1)))))*180/pi;
matr(2*(Con(w,1))-1,w) = cos(angulo*pi/180);
matr(2*(Con(w,2))-1,w) = -cos(angulo*pi/180);
matr(2*(Con(w,1)),w) = sin(angulo*pi/180);
matr(2*(Con(w,2)),w) = -sin(angulo*pi/180);
w = w + 1;
end
q = 1;
s = w;
while q < y + 1
if Rest(q,1) ~= 0
matr((2*Nod(q,1))-1,s) = Rest(q,1);
s = s + 1;
q = q + 1;
else
q = q + 1;
end
end
q = 1;
while q < y + 1
if Rest(q,2) ~= 0
matr(2*(Nod(q,1)),s) = Rest(q,2);
s = s + 1;
q = q + 1;
else
q = q + 1;
end
end
carga = zeros(2*(length(Load)),1);
p = 1;
for e = 1:length(Load)
for a = 1:2
Load(e,a);
carga(p,1) = Load(e,a);
p = p + 1;
end
end
Force = matr\carga;
end
  1 Comment
Star Strider
Star Strider on 21 Apr 2015
It would help if you told us what the error is!
Please copy and paste all the red text in the Command Window, including the line that threw the error.

Sign in to comment.

Answers (1)

joaquin tellez
joaquin tellez on 20 Apr 2015
here is the other code in which i open the excel file
if true
% code
end
arc = input('ingrese el nombre de su excel: ','s');
Nod = xlsread(strcat(arc,'.xlsx'));
PosX = xlsread(strcat(arc,'.xlsx'),2);
PosY = xlsread(strcat(arc,'.xlsx'),3);
Con = xlsread(strcat(arc,'.xlsx'),4);
Rest = xlsread(strcat(arc,'.xlsx'),5);
Load = xlsread(strcat(arc,'.xlsx'),6);
Force = PlantearEquilibrio(Nod,PosX,PosY,Con,Rest,Load) GraficarSolucion(PosX,PosY,Force,Con)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!