step 1: I create a scope,
if (decaySliceApiCall.isSuccess) {
const scope = {}
channels.map((channel) => {
scope[`Ch${channel}`] = {}
decays.map((decay) => {
scope[`Ch${channel}`][`D${decay}`] = decaySliceApiCall.data.data.z.channels[`${channel}`].decays[`${decay}`]
})
})
setScope(scope)
the scope looks like:
e.g Ch0.D10 is a 2D array of numbers
if I use the expression Ch0.D40./Ch2.D40 ....
let expression = "Ch0.D40./Ch2.D40"
if (scope) {
let localScope = { ...scope }
try {
//math.evaluate('fImage=' + expression, localScope).toArray()
const node = math.parse(expression)
const code = node.compile()
console.log(code.evaluate(localScope))
} catch (error) {
console.error(error);
}
}
the outpur is an Error
interestingly,
if i change the expression to:
const node = math.parse('Ch2.D40')
the the output is fine:

hope this helps.
Originally posted by @pramod-bls in #2596 (comment)
step 1: I create a scope,
the scope looks like:
e.g Ch0.D10 is a 2D array of numbers
if I use the expression Ch0.D40./Ch2.D40 ....
the outpur is an Error
interestingly,
if i change the expression to:
the the output is fine:

hope this helps.
Originally posted by @pramod-bls in #2596 (comment)