תכנות נומרי עם Matlab ו-Octave/הכנה: הבדלים בין גרסאות בדף

תוכן שנמחק תוכן שנוסף
Atavory (שיחה | תרומות)
Atavory (שיחה | תרומות)
אין תקציר עריכה
שורה 80:
סימן זה ידוע בשם [[w:en:Command_prompt#Command_prompt|prompt]], והוא מסמן שהמתרגם ממתין לקלט.
 
== פקודות בסיסיות ==
 
=== עזרה ===
 
בהקלדת help בשורת הפקודה נקבל רשימה של האופרטורים, הפקודות והפונקציות שמותקנות בתוכנה.
 
כאשר רוצים לדעת מה פונקציה מסוימת מבצעת ואיך היא בנויה, מקלידים help ולאחריו שם הפונקציה.
 
{{דוגמה|תוכן=
 
<source lang = "matlab">
octave:2> help sin
-- Mapping Function: sin (X)
Compute the sine of each element of X.
 
sin is a built-in mapper function
 
Additional help for built-in functions and operators is
available in the on-line version of the manual. Use the command
`doc <topic>' to search the manual index.
 
Help and information about Octave is also available on the WWW
at http://www.octave.org and via the help@octave.org
mailing list.
</source>
}}
 
=== חיפוש ===
הפקודה lookfor תחפש ביטוי מסוים בדפי העזרה של הפונקציות, ויחזיר את כל הפונקציות המשתמשות בביטוי.
 
 
<source lang = "matlab">
lookfor abs
abs Compute the magnitude of Z, defined as |Z| = `sqrt (x^2 +
y^2)'.
file_in_loadpath Return the absolute name of FILE if it can be found in the
list of directories specified by `path'.
file_in_path Return the absolute name of FILE if it can be found in
PATH.
nextpow2 If X is a scalar, returns the first integer N such that
2^n >= abs (x).
 
</source>
קיבלנו פונקציות המשתמשות בביטוי abs
 
=== פקודות ניקוי ===
* clear - הפקודה תמחק את כל המשתנים הקיימים. אם לאחריה נכתוב שם של משתנה קיים, היא תמחוק רק אותו.
*clc - הפקודה מנקה את ה workspace . מקובל לכתוב אותה בתחילת תוכניות.
 
{{Matlab/octave|מוגבל}}