help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

syntax "if"


From: FelipeLyra
Subject: syntax "if"
Date: Tue, 18 Jun 2019 09:55:48 -0500 (CDT)

I'm trying to make a simple code using "if" :

clear;
clc

dia = input('Day: ');
printf("\n") #para pular linha

mes = input('Month: ','s');
mes = tolower(mes);
printf("\n")

#beta = input('Inclinação do modulo: ');
#printf("\n")

lat = input('Latitude: ');
printf("\n")

gsc = 1367;

if mes == 'january'
  a = 1;
  endif
if mes == 'february'
  b = 2;
  endif
if mes == 'march'
  c = 3;
  endif

and is giving the following error when the month is February or March:

error: teste2: mx_el_eq: nonconformant arguments (op1 is 1x8, op2 is 1x7)
error: called from
    teste2 at line 19 column 1

has anyone ever experienced this ?




--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]