MATLAB ONRAMP SECTION 7 : further practice help

Hello veryone. I just began with MATLAB Onramp course two days back and now i am stuck at a question of further practice area. I am posting a screenshot of the same. Please reply. It would be a great help. :)

Answers (1)

Modify the code that is shown to use the min function instead of max.

3 Comments

i got that part. But i didnt get the part where it is written " use this index to extract from density". Some error was coming.do you want me to repeat the same code by replacing max with min. if yes, could you please explain this code to me, that what is it exactly doing.
Yes, replace max with min. As for what it is doing, that is explained in Task 3.
I think the middle line should be:
[~,ivMax] = max(density) %not v2
v2 was set previous as: v2 = data(:,4);
which is column 4 of data, not from column 2 (which is density)
If the original example is run, densityMax will be 3 instead of 6.11 (because it's indexing v2 instead of density, which come from different columns of data).

Sign in to comment.

Categories

Find more on Language Fundamentals in Help Center and File Exchange

Asked:

on 8 May 2020

Commented:

on 29 Jan 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!