تم الحل ✓
categoryبرمجة وتطوير البرمجيات
schoolبكالوريوس
event_available2026-07-15
السؤال
Transcribed Image Text:
3-
a.
Declare two variables nRow =10, ncol=20.
b. Declare a (10x20) matrix called z with random entries using randn command
c. You need to find the minimum value of the matrix using two nested for loops.
i. Do not use the buid-in min() function
ii. Initialize the minimum value MIN=z(1,1). This initialization step is required.
iii. Use two nested for loops to go over each element in z
iv. Use if statement within the inner loop to test the new value < MIN as follows:
if (z(r,c) < MIN)
end
MIN=z(r,c);
d. Outside the nested loop, use the build-in min() as shown below to test the your
algorithm
MIN1= min(min(z))
MIN and MIN1 should have the same value. Test it by using the following code
if (MIN==MIN1)
disp('Minimum value is found');
else
end
disp(srtcat('MIN=',num2str(MIN));
dis('Minimum Algorithm Failed');
check_circle الجواب — حل مفصل خطوة بخطوة
hourglass_top
🔒
الحل الكامل متاح للمشتركين
اشترك في أرشيف الأسئلة لعرض هذا الحل وآلاف الحلول المفصلة خطوة بخطوة من معلمين معتمدين.