This is matlab, no loops, just simple matlab please neededArray = 25 25 25 25 25
ID: 3910305 • Letter: T
Question
This is matlab, no loops, just simple matlab please
neededArray =
25 25 25 25 25 25 25 25 25 25 25 25 25
25 25 25 25 25 25 25 25 25 25 25 25 25
25 25 25 25 25 25 25 25 25 25 25 25 25
25 25 25 25 25 25 25 25 25 25 25 25 25
25 25 25 25 25 25 25 25 25 25 25 25 25
25 25 25 25 25 25 25 25 25 25 25 25 25
25 25 25 25 25 25 25 25 25 25 25 25 25
25 25 25 25 25 25 25 25 25 25 25 25 25
25 25 25 25 25 25 25 25 25 25 25 25 25
25 25 25 25 25 25 25 25 25 25 25 25 25
25 25 25 25 25 25 25 25 25 25 25 25 25
neededArray is a 13x11 array.
number = 50
I want to insert number to look like this:
neededArray =
25 25 25 25 25 25 25 25 25 25 25 25 25
25 50 50 50 50 50 50 50 50 50 50 50 25
25 50 50 50 50 50 50 50 50 50 50 50 25
25 50 50 50 50 50 50 50 50 50 50 50 25
25 50 50 50 50 50 50 50 50 50 50 50 25
25 50 50 50 50 50 50 50 50 50 50 50 25
25 50 50 50 50 50 50 50 50 50 50 50 25
25 50 50 50 50 50 50 50 50 50 50 50 25
25 50 50 50 50 50 50 50 50 50 50 50 25
25 50 50 50 50 50 50 50 50 50 50 50 25
25 25 25 25 25 25 25 25 25 25 25 25 25
Explanation / Answer
>> neededArray = zeros(11,13); %Create empty array
>> neededArray(:) = 25; %Fill it with 25
>>number = 50;
>> neededArray(2:10,2:12) = number;%Make all inner elements number
>> neededArray
neededArray =
25 25 25 25 25 25 25 25 25 25 25 25 25
25 50 50 50 50 50 50 50 50 50 50 50 25
25 50 50 50 50 50 50 50 50 50 50 50 25
25 50 50 50 50 50 50 50 50 50 50 50 25
25 50 50 50 50 50 50 50 50 50 50 50 25
25 50 50 50 50 50 50 50 50 50 50 50 25
25 50 50 50 50 50 50 50 50 50 50 50 25
25 50 50 50 50 50 50 50 50 50 50 50 25
25 50 50 50 50 50 50 50 50 50 50 50 25
25 50 50 50 50 50 50 50 50 50 50 50 25
25 25 25 25 25 25 25 25 25 25 25 25 25
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.