Matlab - variable no declarada

 
Vista:

variable no declarada

Publicado por emtorres13 (5 intervenciones) el 08/11/2013 04:37:39
hola a todos es que ando haciendo un programa donde necesito detectar el codigo que utiliza matlab para imprimirme que no tengo la variable declarada y modificarlo para un guide que ando haciendo pero no he podido encontrarlo si alguien sabe se lo recomiendo

GRACIAS
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
Imágen de perfil de Jorge De Los Santos
Val: 30
Ha disminuido su posición en 12 puestos en Matlab (en relación al último mes)
Gráfica de Matlab

variable no declarada

Publicado por Jorge De Los Santos (213 intervenciones) el 09/11/2013 09:29:10
Hola

Para verificar si una variable existe puedes usar el comando "exist" y para mostrar un mensaje de alerta en ese caso puedes utilizar los cuadros de diálogos predefinidos de MATLAB como "msgbox", "warndlg", etc...

Saludos.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de JOSE JEREMIAS CABALLERO
Val: 6.975
Oro
Ha mantenido su posición en Matlab (en relación al último mes)
Gráfica de Matlab

variable no declarada

Publicado por JOSE JEREMIAS CABALLERO (5917 intervenciones) el 12/11/2013 12:06:45
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
>> whos
  Name      Size            Bytes  Class     Attributes
 
  A         1x1                 8  double
  ans       1x1                 8  double
 
>> exist('B','var')
 
ans =
 
     0
 
>> exist('A','var')
 
ans =
 
     1
 
>> help exist
 exist  Check if variables or functions are defined.
    exist('A') returns:
      0 if A does not exist
      1 if A is a variable in the workspace
      2 if A is an M-file on MATLAB's search path.  It also returns 2 when
           A is the full pathname to a file or when A is the name of an
           ordinary file on MATLAB's search path
      3 if A is a MEX-file on MATLAB's search path
      4 if A is a Simulink model or library file on MATLAB's search path
      5 if A is a built-in MATLAB function
      6 if A is a P-file on MATLAB's search path
      7 if A is a directory
      8 if A is a class (exist returns 0 for Java classes if you
        start MATLAB with the -nojvm option.)
 
    exist('A') or exist('A.EXT') returns 2 if a file named 'A' or 'A.EXT'
    and the extension isn't a P or MEX function extension.
 
    exist('A','var') checks only for variables.
    exist('A','builtin') checks only for built-in functions.
    exist('A','file') checks for files or directories.
    exist('A','dir') checks only for directories.
    exist('A','class') checks only for classes.
 
    If A specifies a filename, MATLAB attempts to locate the file,
    examines the filename extension, and determines the value to
    return based on the extension alone.  MATLAB does not examine
    the contents or internal structure of the file.
 
    When searching for a directory, MATLAB finds directories that are part
    of MATLAB's search path.  They can be specified by a partial path.  It
    also finds the current working directory specified by a partial path,
    and subdirectories of the current working directory specified by
    a relative path.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar