Discussion:
error: Value on right hand side of assignment is undefined
M***@weirminerals.com
2018-11-23 11:48:33 UTC
Permalink
Hi Guys

Please refer to the below code. This is simplified case of what I am
using, just to demonstrate my issue.

Once complied, the functions are available to be used in the command
window.

"Function B" however does not work, as it gives the error "error: Value on
right hand side of assignment is undefined"

Can someone please assist? I do not understand why the error is occurring.




Kind regards
Mishal Mohanlal
Structural Engineer

Weir Minerals Africa (Pty) Ltd
31 Isando Road
Isando
Johannesburg
South Africa

T + 27 (0)11 929 2908
M + 27 (0)76 680 6954
F + 27 (0)86 632 7611
***@weirminerals.com
weirminerals.com



global.weir

CONFIDENTIAL:
The information contained in this email (including any attachments) is confidential, subject to copyright and for the use of the intended recipient only.
If you are not the intended recipient please delete this message after notifying the sender. Unauthorised retention, alteration or distribution of this
email is forbidden and may be actionable. Attachments are opened at your own risk and you are advised to scan incoming email for viruses before opening
any attached files. We give no guarantee that any communication is virus-free and accept no responsibility for virus contamination or other system loss
or damage of any kind.
Doug Stewart
2018-11-23 15:12:20 UTC
Permalink
Post by M***@weirminerals.com
Hi Guys
Please refer to the below code. This is simplified case of what I am
using, just to demonstrate my issue.
Once complied, the functions are available to be used in the command
window.
"Function B" however does not work, as it gives the error "error: Value on
right hand side of assignment is undefined"
Can someone please assist? I do not understand why the error is occurring.
What I see is that you have a function called B and a variable called B
This is not good!
give them different names and start again and it should work.
Post by M***@weirminerals.com
Kind regards
*Mishal Mohanlal*
Structural Engineer
*Weir Minerals Africa (Pty) Ltd*
31 Isando Road
Isando
Johannesburg
South Africa
*T *+ 27 (0)11 929 2908
M + 27 (0)76 680 6954
*F* + 27 (0)86 632 7611
weirminerals.com
global.weir <http://www.global.weir/>
Twitter <http://www.twitter.com/weirgroup> | Linkedin
<https://www.linkedin.com/company/the-weir-group> | Facebook
<http://www.facebook.com/weirgroup>
[image: WeirLogo]
The information contained in this email (including any attachments) is
confidential, subject to copyright and for the use of the intended
recipient only. If you are not the intended recipient please delete this
message after notifying the sender. Unauthorised retention, alteration or
distribution of this email is forbidden and may be actionable.
Attachments are opened at your own risk and you are advised to scan
incoming email for viruses before opening any attached files. We give no
guarantee that any communication is virus-free and accept no responsibility
for virus contamination or other system loss or damage of any kind.
--
DAS[image: Certificate for 206392]

<https://linuxcounter.net/user/206392.html>
mmuetzel
2018-11-23 15:19:12 UTC
Permalink
Your function A doesn't have a return value. Also you should use a variable
that has the same name as the function it is in. Even if it isn't a syntax
error, it might be confusing.

Try something like:

function val = A(x, y)
val = x + y;
endfunction


Markus



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
mmuetzel
2018-11-23 15:27:47 UTC
Permalink
Post by mmuetzel
Your function A doesn't have a return value. Also you should use a variable
that has the same name as the function it is in. Even if it isn't a syntax
error, it might be confusing.
function val = A(x, y)
val = x + y;
endfunction
Markus
Sorry. That should read: "... you should *not* use a variable that has the
same name as the function it is used in."

Markus




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