[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
DON'T UNDERSTAND WHY I GET - error: subscript indices must be either pos
From: |
victor carreto |
Subject: |
DON'T UNDERSTAND WHY I GET - error: subscript indices must be either positive integers or logicals. |
Date: |
Wed, 30 Jun 2010 13:59:25 -0700 (PDT) |
Hello I made a function "MN.m" yesterday wich worked pretty well...
today I try to use it again and it keeps saying me
octave-3.2.3:23> MN (a,b)
error: subscript indices must be either positive integers or logicals.
the thing that I DON'T UNDERSTAND is why when I made a new file called
"MN_v1.m" it works just fine
If someone can explain to me why is this going on and could tell me
what to do I will be very much appreciated, me and my masters thesis.
thank you all.
the function goes as follows:
function MN = MN ( MD, BM )
# variable initialization
v = [0];
mn = [0];
a = [0];
MN = [0];
# to know how many rows and columns our Inputs have
[num_circuitos,num_pares] = size (BM)
[lambda,num_heligiros] = size (MD)
# the main idea is to take each and every row of the Input 'BM' and
diagonalize the vector forming a 'mat_diag' matrix which will multiply
the input 'MD'. Then we will arrange each partial result under the
previous one.
for i = 1:num_circuitos;
v = BM(i,:)
mat_diag = diagonal (v)
mn = MD * mat_diag
if MN == [0];
MN = mn;
else
MN = [MN;mn];
endif
endfor
# printing the result
MN
endfunction
-----
victor carreto
address@hidden
--
View this message in context:
http://octave.1599824.n4.nabble.com/DON-T-UNDERSTAND-WHY-I-GET-error-subscript-indices-must-be-either-positive-integers-or-logicals-tp2274242p2274242.html
Sent from the Octave - General mailing list archive at Nabble.com.
- DON'T UNDERSTAND WHY I GET - error: subscript indices must be either positive integers or logicals.,
victor carreto <=