Message Boards Message Boards

0
|
1961 Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Import "Sample.jpg" in lesson 10 of An Elementary Introduction to WL

Posted 1 year ago

Hello there,

I am following a video lecture series following Stephen Wolfram's Elementary Introduction to the Wolfram Language, and in Lesson 10, the lecturer shows how to import a sample image by typing:

Import["sample.jpg"]

He gets the following image:Video Lecture Result

However, when I type in the same thing on my copy of Mathematica (v13), this the error that I get: My Result

Thanks for any and all help,

Eleazar

2 Replies
Posted 1 year ago

The argument to Import should be a path to where the image exists on your computer. You probably don't have that image on your computer. If it is on your computer, then it's not in the same directory as the notebook where you're running this code. If you type Import[", you should see a little popup that says "File Browser". You can click that to search for the file you want to import.

If the exact image isn't important to the tutorial, you can use one of the built in sample images.

ExampleData["TestImage"]

This will give you an output that looks like this:

{{"TestImage", "Aerial"}, {"TestImage", "Aerial2"}, <<...etc...>>, {"TestImage", "Volubilis"}}

You can choose one of those:

ExampleData[{"TestImage", "Apples"}]

If the tutorial is about Import per se, then you'll need to have a file on your local computer that you want to import.

POSTED BY: Eric Rimbey

Thanks, Eric. I think I can use CurrentImage in place of the sample.jpg image, so that's what I'll do. I was just wondering what the issue was, so thanks for telling me. :)

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract