Quantcast
Channel: Behaviour of `ToExpression` inside a function definition - Mathematica Stack Exchange
Browsing latest articles
Browse All 2 View Live

Image may be NSFW.
Clik here to view.

Answer by Nasser for Behaviour of `ToExpression` inside a function definition

It is because "arr" inside string do not bind to the input argument. You have to do it separatly.a = {{1, 2}, {3, 4}};f[arr_] := ToExpression[ToString[arr] <> "[[1,1]]"]And now it worksBut this...

View Article


Behaviour of `ToExpression` inside a function definition

I want to create a function that takes in an array of unknown size and do some index operations on it. I am using strings to construct the expression and then trying to use ToExpression for evaluating...

View Article

Browsing latest articles
Browse All 2 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>