Attachments:
|
|
|
Drawing Tools palette: where can I find it in Mathematica 13.2 on a Mac?
I do not see it in the Graphics menu or the Palettes menu.
|
|
|
In a rather rare occurrence, I believe that this functionality has been subsumed into the new "canvas" functionality, accessible through Graphics -> New Canvas. If this is missing some functionality that you need, please let me know and I'll inquire with our team about it, as I've never used this functionality myself.
|
|
|
That's a wonderful initiative to spread Wolfram to new learners. Thanks @Arben.
|
|
|
A few questions from a beginner:
- All Functions: the basic syntax of functions, how to interpret and resolve error messages, how to use help pages, how to find the best function(s) to use in a given situation
- Shortcuts/Cheatsheets: Keyboard, shortcut keys, and other cheatsheets pages to help navigate the syntax, system, etc.
- Best practices/tips and tricks: writing code, debugging, making it intelligible to others, most useful general functions, etc.
- Entities/Datasets: list of available items, how to best pull data, identify data elements available within in, the best way to utilize, etc.
- Specific functions: MAP and related functions - step x step and primary ways it's used. How to find the longest word in WordList[]
Thanks.
|
|
|
How to find the longest word in WordList[]
WordList[] // MaximalBy[StringLength]
(* {"electroencephalography"} *)
|
|
|
Attachments:
|
|
|
Use RuleDelayed
gr /. {p_Real, q_Real} :> {q, p}
|
|
|
I am having troubles importing the exercises into Wolfram Cloud application. I am working on android tablet and I extracted the exercises into Download folder. There is no import option. Please help.
Attachments:
|
|
|
It’s the same situation in the iPad/iOS flavor of the app. I think I had to upload notebooks from the desktop version during my previous testing. :-( The web interface has a button which will allow you to upload notebooks…

|
|
|
Arben, Don’t know whether it’s germane to the discussion today, but can you explain the difference between Animate[], and Manipulate[]? To me, they appear to do the same thing. Thanks.
|
|
|
It's a totally relevant and reasonable question to ask. They are indeed very similar, and I don't believe Animate does anything that Manipulate can't: it's basically a stripped down version of the full Manipulate interface which has fewer possible options and which automatically begins animating upon evaluation, that's all!
|
|
|
Hi everybody—I've added today's data files to the Course Materials folder, so you can now use them while trying out today's notebook yourself.
|
|
|
Attachments:
|
|
|
Hi Mitch—you could calculate their ratio, or perhaps use the QuantityMagnitude function?
|
|
|
Hello all,
please see notebook. 
Attachments:
|
|
|
Hi Peter! It's a fair point; I was mixing up my comparisons in a way that could well be confusing. Honestly, my intent was not to make a fair comparison between a properly-specified loop construct and mapping, but to—maybe a bit too theatrically—demonstrate that the former is messy and "redundant" compared to the latter. (And re: list[i], I think the audio should indicate that the idea was "something like" or "some function of" or "something to do with", trying to indicate that inside the loop, we'd be doing something that required us to index list with a dummy variable, whereas with Map we wouldn't need to do that.) Still, it could lead to confusion, so my apologies for that!
|
|
|
Hello,
i, j, and k are still legitimate names wherever the user of a language has a choice at all. Fortran speciality was that names starting with i,j,k and as a matter of fact l,m, and n were associated with integers if not otherwise specified. Later descendants of FORTRAN avoided giving any pre-defined semantics to names; PL/I took an extreme attitude and despite being a colossal language had no reserved words at all, cf.
https://www.ibm.com/docs/en/epfz/5.3?topic=sbcs-identifiers Therefore, in subprograms it was mandatory to supply declarations with attribute BUILTIN if desired to revert to the original definition of standard functions.
|
|
|
Hi again Phil—the first part should be doable without issue with just the regular Graphics3D interface (e.g. what you see when you use Plot3D or anything like that). The second part is also doable, but in a few different ways... I think the best way would be to use Animate or Manipulate (along with some of the camera positioning/perspective options). This way, you could set up the visualization to animate however you like (w.r.t. the flythrough and all), and the user could pause it at any point to rotate it and so on because in the end, it's still a Graphics3D object like discussed above. This could be a bit tricky to set up, as flythroughs are much easier to explain than they are to code, but it can absolutely be done. Exporting a video would also be completely trivial!
|
|
|
From comments in the presentation today, I believe there is some other place that [many] questions are being asked/answered. I don't see that area or any way to get to it. What am I missing? Help!
|
|
|
BigMarker software while replaying today's session. I'll look for that icon tomorrow during the live session. Are the questions of other participants viewable, or can I only view my own questions and answers? TY.
|
|
|
Hey Phil—glad you found it, and hope you can make use of it for the rest of the sessions (And just to repeat: we collect all of these Q&As and upload them at the end of each week, as well as have a full session Q&A with questions submitted through the post-session survey.) Questions and answers are, by default, not visible to other participants, but we can (and do) "publish" them so that they become visible. Not all questions will be published for everybody to see in real-time, but many will.
|
|
|
Can you explain the difference between Block[], and Module[] when used for local variable scoping? To me, but Block[] example isn’t clear…
|
|
|
Hi J—if it works for you, I'm happy to discuss that in some depth at Friday's review session so everybody can see it and hear it explained. (If you need an answer sooner, I could write it up here.)
|
|
|
Arben, One area I’ve struggled with concerns Levels of expressions. So in preparation for my question(s) concerning MapAt, and MapThread, I figured I’d study “the book” (https://reference.wolfram.com/language/tutorial/Expressions.html#24855). I do alright until almost the very end where negative Levels are introduced… Level[u, {-1}] results in {a, a, a, a, f} because these are the bottom leaves on the TreeForm, as near as I understand it. Where things start going sideways is when Depth[] is introduced. The next example shows, Depth[g[a]] which returns 2. Why is it two? Is it because Depth counts the expression head, “g” as well as the argument “a” as a level? 
The final example also doesn’t behave as I expect. It says, Level[u, {-2}] results in {g[a], h[a]}, but if we’re starting at the bottom of the TreeForm and proceeding up two levels, why aren’t {f[a], f[a], f[f]} also included? They all have two levels up from the bottom of the TreeForm… 
|
|
|
Hi J—some great questions here, and I'm glad that you're perusing the documentation and getting some evidently great use of it. Let's see if I can't help out with these questions, one by one:
Why is it two? Is it because Depth counts the expression head, “g” as well as the argument “a” as a level?
As I understand it, yes—that's exactly why. Since you've asked specifically for the depth required to write g[a] (rather than, say, a), you're getting the level at which g[a] could first appear, traversing a tree down from the top. The a inside the g[a] is indeed one level deeper (at level 3, in u), but any non-atomic expression will by necessity span multiple levels when asked for in this manner, right? I.e., any non-atomic expression can be represented as head[el,...], so if you ask for the Depth of such an expression, we return the depth corresponding to where that expression could begin, despite the fact that the el exists one level deeper (and el could itself be compound, so it could keep going down the tree).
The final example also doesn’t behave as I expect. It says, Level[u, {-2}] results in {g[a], h[a]}, but if we’re starting at the bottom of the TreeForm and proceeding up two levels, why aren’t {f[a], f[a], f[f]} also included? They all have two levels up from the bottom of the TreeForm…
I agree that this is a confusing, and I think it's partly our eyes playing tricks on us because of how TreeForm represents expressions; I would have guessed the exact same thing that you did. However, there's one clue in your image: what's special about the two branches which were actually returned? They're vertical. Why should that matter? It seems like it shouldn't, but... Take a look at u once again. It's:
u=f[f[g[a], a], a, h[a], f]
Notice what's missing: do you see any f[a] or f[f]? They don't actually exist in u; they only exist if you're extracting certain branches within u. Level is just telling us which expressions within u which explicitly exist and have a level of precisely -2—and that's g[a] and h[a], and nothing else. Hopefully that's a sufficiently satisfying response! I've asked our tech folks if this understanding is correct, and will update here when I hear back.
|
|
|
Thanks for clarifying these issues, Arben!
|
|
|
Of course! I've received confirmation that this is the right way to think of this, and suggested a way of looking at the expression that might make this clearer still: ExpressionTree[u, "Subexpressions"]
|
|
|
Hi all;
Let's work out the final example of the already quoted https://reference.wolfram.com/language/tutorial/Expressions.html#24855) Level[u, {-2}]
We must determine
"The parts of u at level -2 are those that have depth exactly 2:"
We refer to the drawing as in the above documentation, assuming a directed graph whose edges point "downward" in the representation. the Depth of the root is 4, corresponding to the 4 levels, arranged horizontally in the given representation (Of course, the concept of Depth is independent of the drawing) In the f-a-h-f-line, the depths are 3-1-2-1 respectively.
In the g-a-a-line, the Depths are 2-1-1 respectively
This yields the desired result. Why aren't the technical writers of Wolfram able to give proper recursive definitions of this stuff?
Cheers
Peter
|
|
|
Hi Peter, please see the documentation for Depth, noting specifically that Depth takes one argument—expression depth in this sense is not context-dependent.
|
|
|
Here is an attempt to recursively define Depth using Level with positive second parameter. this could in turn be used for a recursive definition for negative second parameter of Level and verified by the examples loc. cit.
|
|
|
Hi; Yesterday I noticed that you used a picture of your cat as input to a Sin[] function. I was under the impression that all input to Sin[], Cos[], Tan[], ect. needed to be in radians and if the input was not in radians, then it had to be multiplied by 2 Pi to get it in radians. Thanks, Mitch Sandlin
|
|
|
Mitch, Per the documentation for these functions, the arguments are assumed to be in radians. You can use the function Degree to convert between degrees and radians. Hope this helps. J.
|
|
|
Indeed, they are assumed to be in radians—but Sin (and the other trig functions) have an Attribute called Listable. This means that when you feed them a list of any kind, they automatically go inside the list and work at the lowest possible level: try, for example, Sin[{1,2,3}] or Sin[RandomInteger[{0,9},{5,5}] and you'll see. The magic ("") here occurs when when feeding an image to Sin: some functions, when fed an image, bypass the Image part of the expression and work directly on the ImageData, e.g. the matrix of RGB pixel values of an image. Because a matrix of RGB pixel values is simply a nested list (height, width, then 3 color values per pixel), Sin is happy to go in there and work on all of the pixel values. So, Sin[img] gives Image[Sin[ImageData[img]]], or: Sin of an image returns a new image where the R, G, and B values of every pixel of the image have had their sine taken. (And because Sin expects radians, it treats those values like radians.) Hopefully that clarifies things!
Attachments:
|
|
|
Great content thus far.... I wanted to ask about wolfram being leveraged as part of a larger code base. How would that work?
|
|
|
Arben, do you have a sampledata.xls file that we can download into our local computers? Alternatively, do you have the URL for a sampledata.xls? You may have identified teh URL in your presentation, but I didn't write it down. TY.
|
|
|
Hey Phil! Good call—I've added that file to the Course Materials folder. The link should be in your reminder emails!
|
|
|
Hi. As someone with previous Mathematica experience (over 20 years ago!), I’m looking forward to this review. Since I work from an iPad, I’m interested in learning the differences between the desktop and on-line versions of the program. So far, the distinction between commands like CloudExport, and Export are lost on me. Hope we can (briefly) address these topics. Look forward to getting started. Thanks. J.
|
|
|
Hi J! We'll talk a little bit about the difference between local and cloud functionalities for sure. Of course, if you want more information or clarification or would like to get into specifics more than we do in the lessons, you can submit your question for one of our weekly review sessions and I'll go over it in more detail :). Looking forward to seeing you there!
|
|
|
Reply to this discussion
in reply to
|