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
I think you want
Built-in Function: strcmp (s1, s2)Return 1 if the character strings s1 and s2 are the same, and 0 otherwise.