Adept Scientific - English
The world's best software and hardware for research, science and engineering.
flag arrow
clearclear

 Adept Store | register Join My Adept | Flags  
Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055  
UKdedksvnofi
Home
Products
Training
Events
 Buy Online
Downloads
Academic Discounts
Support
My Adept
International |  About Us |  Adept Scientific Blog |  Contact Us |  Press Room |  Jobs
Adept Scientific on Facebook Adept Scientific on Twitter Adept Scientific on YouBube Adept Scientific on LinkedIn


The Next Steps

• Ask us a question
• Watch Maple Video Demonstrations
• Buy Maple Now
• View Maple Pricing
• Download a Brochure
• Request a Brochure
• Request an Evaluation
• Meet Our Team
• Read our RSS Feeds

Learn More

Maple Home
Maple 16 Overview
Maple 16 Professional
Maple 16 Academic
Maple 16 Student Use
What's New in Maple 16
Maple New Features
Datasheet

Maple History
Recorded Online Seminars

MapleSim
MapleNet
Maple T.A.
BlockImporter™
Maple Toolboxes

Maple Rave Reviews
Maple Study Guides
Books about Maple
System Requirements

Latest Information

New Features: Professional
New Features: Academic
Maple Features
The Maple Reporter Online

Service & Support

Maple Primes
blogs, forums etc

Elite Maintenance Program
Application Centre
Powertools
Search the Knowledge Base
Technical Support request

List Archives >  Maple User Group List Archive >  Archive by date >  This Month By Date >  This Month By Topic

[MUG] easiest way to write

Search email archive for  

[MUG] easiest way to write
Author: Maple User Group    Posted: Thu, 13 Feb 2003 09:08:56 -0500

>> From: Maple User Group />
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

To: /> Subject: easiest way to write calculated data to a file with Maple ?
From: Joe Riel /> Date: 30 Jan 2003 22:17:37 -0800

"jim fukuyama" writes:

> >> From: "jim fukuyama" /> >
> Greetings,
>
> I am running an iterative equation that plots hundreds of variable
> points for a given parameter value...how exactly do write to a file
> the following example data ?
>
> counter point parameter
> 1 2.4533 3.2
> 2 2.46 3.2
>
> I saw previous internet postings that all were different, I am looking for
> the easiest way for a beginner...

Well there is more than one way to handle this,
so expect more than one answer. You didn't specify
the release of Maple that you are using,
I'll assume R6 or greater.

I'm not sure what you meant by "an iterative equation",
but will assume that your program has a loop and that
you want to print stuff each time through. An easy
way to do that is

file := fopen("<filename>",'WRITE'); # substitute <filename> with the actual filename
try
<start loop>
fprintf(file,"%d %.4f %.2f", counter, point, parameter)
<end loop>
finally fclose(file)
end try;

Note that the loop is enclosed in a `try' statement that includes
a `finally' statement that closes the file. This is important,
otherwise an error in your loop will leave the file open.
Look up help for `fprintf' to understand the format.

Joe Riel


-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

To: /> Subject: easiest way to write calculated data to a file with Maple ?
From: Joe Riel /> Date: 30 Jan 2003 22:53:28 -0800

"jim fukuyama" writes:

One more thing, which I invariably forget on the first try.
If you use fprintf, be sure to add a `\n' at the end of the string.
For example

fprintf(file,"%d %.3f %.2f\n", counter,point,parameter)

Joe


-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

From: Stanley J Houghton /> Date: Fri, 31 Jan 2003 16:50:43 +0000
To: /> Subject: easiest way to write calculated data to a file with Maple ?

This explained with examples in the help pages for functions fopen,
fprintf and fclose.

Just type fprintf and hit F1. The example you want is at the end of
the help page (at least in my version).

Stan

On Fri, 24 Jan 2003 04:24:23 +0000 jim fukuyama
wrote:
>
> >> From: "jim fukuyama" /> >
> Greetings,
>
> I am running an iterative equation that plots hundreds of variable
> points for a given parameter value...how exactly do write to a file
> the following example data ?
>
> counter point parameter
> 1 2.4533 3.2
> 2 2.46 3.2
>
> I saw previous internet postings that all were different, I am looking for
> the easiest way for a beginner...
>
> Any help is appreciated !!
>
> Jim
>
>
>
>
>
> _________________________________________________________________
> Add photos to your e-mail with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>




Previous by date: [MUG] Re: Generating a compound poission process in Maple, Robert Israel
Next by date: [MUG] AW: Guaranteed multiple-precision results,  Thomas Richard
Previous thread: [MUG] Suggestion to Maple development group: add MatrixDE(),  Rouben Rostamian
Next thread: [MUG] Guaranteed multiple-precision results, Vincent Lefevre



Ready to buy?

For more pricing information:
Visit our webstore, call us on +1 800 724 8380 or email us at info@adeptscience.com

Featured Downloads

Maple 16 & MapleSim 5 Professional Brochure
Maple 16 Academic Datasheet
Maple 16 & MapleSim 5 Academic Brochure
Maple 16 What is New datasheet
Maple 16 Professional Datasheet
Maple Whitepaper: Driving Innovation - How mathematical modeling and optimisation increase efficiency and productivity in vehicle design.
MapleSim Whitepaper - Technological Superiority in Multi-Domain Physical Modelling and Simulation

Latest Downloads

Maple 16 Programming Guide
Maple 16 User Manual
Maple 16 Academic Datasheet
Maple 16 Professional Datasheet
Maple 16 & MapleSim 5 Academic Brochure

Product Reviews

"Without the Maple software, we would have to spend weeks generating the equations of motion for every experiment. Then the chances that we did it right would basically be near zero. There would always be a mistake somewhere. It is very difficult to set up a dynamic motion model by hand."
- Jean-Claude PiedBeouf, Ph.D Manager of Robotics, Canadian Space Agency

"Its very good - highly accurate and easy to use. The speed of Maple allows me to change equations and quickly reintegrate them into the application, so more possibilities can be explored to achieve the precise effect desired."
Shawn Neely, Senior R & D Director for PDI/Dreamworks

Latest News

Connectivity to major CAD systems extended in Maple 16
MapleSim Breaks New Ground in Hardware-in-the-Loop real-time simulation for planetary rovers
MapleSim Breaks New Ground in Hardware-in-the-Loop real-time simulation for planetary rovers
Maths software usability reaches new heights with Maple 16
"MapleSim was an eye-opener for us.
adept

Top of the Page

Popular Links: ChemDraw | ChemOffice | Data Acquisition | Data Analysis | EndNote | Maple | MapleSim | Mathcad | MathType | Quality Analyst | Reference Manager | VisSim

EU ePrivacy Directive | Our Privacy and Terms and Conditions Statement
All Trademarks Recognised. Copyright © 2012, Adept Scientific plc.
Site designed and maintained by Lyndon Ash

Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055