انت هنا الان : شبكة جامعة بابل > موقع الكلية > نظام التعليم الالكتروني > مشاهدة المحاضرة

Computer Lecture-3

Share |
الكلية كلية التربية للعلوم الصرفة     القسم  قسم الرياضيات     المرحلة 1
أستاذ المادة طفول حسين عمران الخفاجي       12/03/2019 19:36:41
VECTORS AND MATRICES IN MATLAB
Vectors
The most direct way is to put the values that you want in the vector in square brackets, separated by either spaces or commas. Example:
>> v = [1, 2, 3, 4]
v =
1 2 3 4

The colon operator can be used to iterate through the regularly spaced values. Example:

>> vec = 1:5
vec =
1 2 3 4 5

With the colon operator, a step value can also be specified with another colon, in the form (first: step: last). Example:

>> nv = 1:2:9
nv =
1 3 5 7 9

Similarly, the linspace function creates a linearly spaced vector; linspace(x,y,n) creates a vector with n values in the inclusive range from x to y. For example, the following creates a vector with five values linearly spaced between 3 and 15, including the 3 and 15:

>> ls = linspace(3,15,5)
ls =
3 6 9 12 15

Vector variables can also be created using existing variables. For example, a new vector is created here consisting first of all the values from nv followed by all values from ls:


المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .
الرجوع الى لوحة التحكم