Matlab - Problema con get de un edit

 
Vista:

Problema con get de un edit

Publicado por Edwin Barrera (3 intervenciones) el 19/03/2013 21:03:04
Hola como estan, soy nuevo en matlab e intento desarrollar un programa, mi problema segun matlab basicamente es el siguiente:
??? Error using ==> mtimes
Inner matrix dimensions must agree.

Error in ==> Sgrads>Calcular_Callback at 329
Pgr(i)=Pref+(log(1+(Dg*Cg*((Zref-Zyac)-Profund(i))/144))/Cg)
hize un seguimiento y resulta que la variable SG la esta tomando de la siguiente manera
SG =

NaN
0.8000
NaN
NaN
supongo que esa es la raiz del problema pero no se como solucionarlos creo que el codigo dle get esta bien, SG es un edit text subrayo el get para que se den cuenta.

De antemano agradezco cualquier tipo de colaboracion prestada, estoy estancado y me gustaria saber si alguien me puede ayudar.

function Calcular_Callback(hObject, eventdata, handles)
global Tigas Mg Dg Cg fases m Tgas EspC deltaZ Profund Pref SG Tsup Zref LGC Do Tdepth Dw WOC GOC
Pref= str2double(get(handles.Pref,'String'));
SG=str2double(get(handles.SG,'String'))
Cg=str2double(get(handles.Cg,'String'));
Tsup=str2double(get(handles.Tsup,'String'));
Zref=str2double(get(handles.Zref,'String'));
LGC=str2double(get(handles.LGC,'String'));
Do=str2double(get(handles.Do,'String'));
EspC=str2double(get(handles.edit14,'String'));
Tdepth=str2double(get(handles.Tdepth,'String'));
deltaZ=str2double(get(handles.Dintervals,'String'));
Dw=str2double(get(handles.Dw,'String'));
WOC=str2double(get(handles.WOC,'String'));
GOC=str2double(get(handles.GOC,'String'));
n=ceil(EspC/deltaZ)
Profund=0
Patm=14.69594877551;
Zyac=abs(Tdepth-EspC);
for i=1:n
if i~=n
if i==1
Profund(i)=deltaZ;
else
Profund(i)=Profund(i-1)+deltaZ;
end
else
Profund(n)=Profund(n-1)+(EspC-Profund(n-1));
end
end
switch fases
case 1
case 2
%una fase
switch m
case 1
Tsup
Patm
Mg=28.96*SG
Dg=Patm*Mg/(10.73159*(Tsup+459.67))
switch Tgas
case 1
case 2
%real
Tgas
for i=1:n
Pgr(i)=Pref+(log(1+(Dg*Cg*((Zref-Zyac)-Profund(i))/144))/Cg)
end
Gradiente=[Profund,Pgr]
case 3
%ideal
Pgi(i)=exp(log(Pref)+(Dg*((Zref-Zyac)-Profund(i))/(144*Patm)))
Gradiente=[Profund,Pgi]
end
case 2
P(i)=Pref+0.052*Do*((Zref-Zyac)-Profund(i))
end
set(handles.uitable1,'Data',Gradiente)
case 3
%dos fases
case 4
%3 fases
end
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