help-octave
[Top][All Lists]
Advanced

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

Re: error: operator -: nonconformant arguments (op1 is 3x1, op2 is 10x1)


From: James Sherman Jr.
Subject: Re: error: operator -: nonconformant arguments (op1 is 3x1, op2 is 10x1)
Date: Fri, 11 Nov 2011 21:16:49 -0500

2011/11/11 ishi soichi <address@hidden>
I have been trying to debug it... ;)

If I put "keyboard" near the line of the error and execute it, it
seems to complete the loop (it generates "keyboard" iteration times).
But once it gets the part producing the solution, it gives the error...

soichi


2011/11/12 Jordi Gutiérrez Hermoso <address@hidden>
On 11 November 2011 20:29, ishi soichi <address@hidden> wrote:
> my code generates an error
> error: operator -: nonconformant arguments (op1 is 3x1, op2 is 10x1)
> error:   /Users/xxx at line 133, column 9
> which is at
> delta_3 = a_3 - yy;

I recognise this as code from the machine language course, so I know I
can't ask you to share code yet so we may understand what is going
wrong. My suggestion then is to try to debug your code. For example,
write "keyboard" near the line where the problem occurs (make sure you
have the right line) and make sure the sizes are what you think they
are. Also try to write in debug mode the code that seems to be
failing. Write "dbcont" or "dbquit" to get out of debug mode.

HTH,
- Jordi G. H.


_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave


For debugging problems like these, I usually do something like

if size(a_3,1) == size(yy, 1),
    delta_3 = a_3 - yy;
else
    keyboard;
endif

Then if it executes the keyboard command, you know it would be when you'd have your problem (especially when it sounds like this bit of code is in a loop, which may not trigger the error everytime).  Then you can go about debugging and seeing what the other variables are at the time when the error would have occurred.

Hope this helps.




reply via email to

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