ابي مساعده ... تمرين في المات لاب

/بلييييز ابي مساعده في هذا السؤال لاني مو فاهمه للمات لاب وابي احد يساعدني فيه اذا احد يعرف او اذا محد يعرف وقرأ الموضوع يكتب اي رد بس احس ان في احد معطيني وجه بلييييييز

هذا السؤال
use function rand and round to generate:
a) a random integer in the rangE (-5,5)
b) a random integer in the range (-2 to 10)

[hint: rand generate a number between 0 and 1. think about how you need to stretch and move this interval to get the required]

_write an m-file that takes an integer N as input and generates N random integers in the range (-5 to 5) and N in the range (-2 to 10) . use hist and subplot to plot the distribution of these integer in one figure but in different subplots. what do you notice about the distributions as you increase N?

اووكي انا الي فهمته انه مستحيل تساعدوني من غير ماابدأ الحل
وانا الصراحه ماافهم شي في الماتلاب لا اساسيات ولا هم يحزنون
بس راح اكتب البدايه وابي اعرف اذا هيا صح ولا لا بس بليييييييييز ابغى رد لان من جد مو فاهمه

>>round(rand(5,5)*3+4)
it that right??
or
>> round(rand(5,5)*10-5) is that right or not
and then what i have to do?

مهندس احمد انا قرأت التعليمات الي كاتبها
انا مو قصة ابغى اضحك على الدكتور او شي انا بجد مو فاهمه والله لو فاهمه كان سويتها وخلصت زي التمارين الثانيه يعني مخلصه كل الهوم ورك بس الي بالمات لاب من جد مو فاهمته بس ابي افهم ايش اسوي خطوه بخطوه لانه هوا ماشرحها على طول دخلنا على المابسشن وقال لنا هذا هوم ورك حاولو فيه بس بجد مو فاهمه
بليييييييز اي احد عارف يقولي كيف احلها

انا مش قصدك انك تضحكى على الدكتور هو مش خسران حاجة سواء تعلمتى او لم تتعلمى كده كده راتبه هيوصله كل شهر
المهم فعلا انك تتعلمى مش مهم انك تسلمى الهوم ورك او لا
على العموم كويس انك عرفتى انه لازم تبدائى فى الحل ودى خطوة جيدة
وهنا ايضا الهليب حول هذه الدالة اتمنى انك تقراءيه
http://www.mathworks.com/help/techdoc/ref/rand.html

بالنسبة للجزء الاول هذا الحل صحيح

round((rand(1,11)*10)-5)

thanx a lot ahmed
i’ll show u what i wrote and could u tell me if it is right or not
i wrote it in m-file
int=10*rand-5
round(int)
for i=1:n
vect=[vect round(int)]
hist(vect)
end

كذا صح ؟ والثانيه راح تكون نفس الطريقه مع تغير الارقام

ومررررررره تسلم

n غير معرفة وارجو اخبارى بوظيفة هذا البرنامج

في السؤال في الفقره الثانيه يبغاني اسويها n times

so
i don’t know if it is ok but i started like that

function Probsheet2(n)
and then what i wrote
لاني بجربها كم مره لين مااوصل ل 5 او -5
وبشوف المعادله الي كتبتها اوكي ولا لا

انا هنا ماني منزله المات لاب بس انا بشتغل عليه بالجامعه وهذا الي سويته اليوم

او ممكن تستخدمى امر input علشان تاخدى قيمتها من المستخدم

nice

so what i did it was right

input>>>فين استخدمه هذا الامر بالضبط يعني بدال ايش استخدمه؟

انا بكره ان شاءالله بجرب الي كتبته ليا
round(rand(1,11)*10-5)
وابغى اقارنه مع جوابي بس عشان بحاول افهم اكثر واكثر

اتمنى اني افهمه تماااااااااااااااام

نفذ الامر الاتى
>>help input
للتعرف على الامر
حيث يمكنك استخدامه فى اظاهر رسالة للمستخدم تخبره بادخال عدد مرات تنفيذ البرنامج

هذا سؤال ثاني بدي ياك تشوفه وتقولي اذا اوكي الي بدأته او لا

[B]2. Generate a random 2 x 2 matrix M with values in the range (-1 to 1) and then alter the matrices to make them symmetric. Use the function eig to generate eigenvalues and eigenvectors. Check that the eigenvectors are orthonormal. [10%]

Using the functions in PlottingExamples.m, write an m-file that iteratively applies a symmetric matrix M to a random 2D vector x and plots the movement of the vector as the system iterates (ie plot x, Mx, M2x etc as positions in 2D space). Use your m-file to plot the trajectories of several starting vectors. Describe the behaviour for different random matrices and how it relates to the eigenvectors and eigenvalues of the matrix. [30%]

Now generate non-symmetric matrices. Can you get the system to behave in different wayss? Can you see any relation between system behaviour and the eigenvalues and eigenvectors of the matrix? [15%
][/b]
انا هنا بدأت الفقره الاولى تقريبا تشبه للسؤال الاول
هذا حلي
a=[rand2-1 rand2-1 ; rand2-1 rand2-1];
a(2,1)=a(1,2)
[V,D] = eig(a)
A=[V(1,1); V(2,1)]
B=[V(1,2);V(2,2)]
c=dot(A,B)
n=norm(A)
n=norm(B)
بس الفقره الثانيه من السؤال كيف ابدأها؟؟ صراحه مو عارفه

هذا الرابط فيه [B]PlottingExamples.m بس اني مو عارفه كيف احل او ابدأ او ايش اسوي

https://studydirect.sussex.ac.uk/file.php/12009/PlottingExamples.m
[/b]

بالنسبة للسطر الاول يمكن استبداله بالاتى

a= rand(2,2) * 2 - 1;

افضل لانه قلل الكود المستخدم
وبالنسبة للباقى تمام
وبالنسبة للدالة PlottingExamples.m يتطلب باسورد ويوزر
من فضلك ارفقيها فى المنتدى

سورري راحت علي نومه
راح ارسلك الباسورد على الخاص مااقدر احطه عام لانه باسوردي الخاص حق االجامعه
بلييز اليوم التسليم

اذا فتح معاك ادخل على
Mathematics and Computational Methods for Complex Systems

بعدين انزل بالصفحه الين برقراف 4 المات لاب

4Matlab. Programming networks in matlab.
For those unfamiliar with MatLab, please look at the on-line tutorial.

[ul]
[li] Example problem sheet with answers PDF document[/li][li] problem sheet 2, part 2 (60% of total mark) PDF document[/li][li] PlottingExamples.m m-file which gives examples of plotting and pausing to view the output text file[/li][/ul]

راح تلاقيه هنا في ويك 4

لا ترسل لى الباسورد
فقط ارفق الملف المطلوب فى المنتدى

مااعرف ارفقه

أضغط على زر اضافة رد وفى اخر الصفحة ستجد الملفات المرفقة ومن خلال هذه النافذة يمكنك اضافة الملفات المرفقة