Message Boards Message Boards

0
|
7058 Views
|
7 Replies
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

Simple loop example

Posted 9 years ago

I am new to Mathematica. Just trying to test a simple loop example: Do[Print[i^2], {i, 4}] It is a copy/paste from a published example with an expected outcome 1 4 9 16 Instead Mathematica output displays something different, please see the attached. Your help will be highly appreciated Thanks, Larry

Attachments:
POSTED BY: Larry Dubov
7 Replies
Posted 9 years ago

Larry, All I use is the built in documentation, hit Help and choose Wolfram Documentation, pick a topic, all links go to examples and they are copy and paste-able. Start with System Operation & Setup, and choose notebook interface, will give you a heads up start. P.

POSTED BY: Paul Cleary
Posted 9 years ago

Paul - Thank you again!

Much appreciated. Is there any "Get Started with Mathematica" where these simple things are covered? A book or other materials you can recommend for a quick start?

POSTED BY: Larry Dubov
Posted 9 years ago

Larry, go into the Help system and search for "Virtual Book." It's good for getting started.

POSTED BY: David Keith
Posted 9 years ago

Thank you David

POSTED BY: Larry Dubov
Posted 9 years ago

it is Shift+enter while the cursor is anywhere in the code, unless you use the keypad (separate part of main keyboard), then you can just hit enter.:)

POSTED BY: Paul Cleary
Posted 9 years ago

Hi

It would seem you are trying to input it in free-form input. Just paste the code directly onto the page at the flashing cursor, don't click on the little + tab.

POSTED BY: Paul Cleary
Posted 9 years ago

Hi Paul - thank you for the prompt response. If I paste the code as you suggested and hit the enter button, the cursor moves to the next line and I see no Output. The only way I discovered to generate an output is to start with "=". This seems to switch Mathematica into the free-form input

Your help is highly appreciated. Larry

POSTED BY: Larry Dubov
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