MATLAB Fundamentals course problem creating a local function
21 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi , I was trying to complete the MATLAB fundamentals course and I encountered a probel in chapter 15 .1 last part "Create and call a local function" . I followed the isntructions and my answer was just like the solution provided , I even tried copy pasting the solution cell-wise but the answer cannot pass the last test, i.e., "Is pp calculated from the function paretoperc?" . Someone please help me with it. I skipped it for now and completed the rest of the course and now my progress is stuck at 99%.
3 Kommentare
Antworten (3)
Renee Coetsee
am 15 Mär. 2022
Bearbeitet: Renee Coetsee
am 15 Mär. 2022
There is an issue with this task. You can resolve the issue by adding clear in the very first line of the script.
More information can be found here:
13 Kommentare
Renee Coetsee
am 15 Jun. 2023
Hi Ibrahim, thanks for sharing your code.
You created the function correctly but you also need to use the function by adding this line of code above the function:
pp = paretoperc(medals);
If you click "See Solution" you can see the whole script. I hope this helps!
Image Analyst
am 13 Mär. 2022
Bearbeitet: Image Analyst
am 13 Mär. 2022
Maybe it really wants "medals" (like it said) for the input argument rather than "x" like you put.
Attach your code if you want us to run it. (I don't want to type all that in.)
3 Kommentare
Image Analyst
am 13 Mär. 2022
You need to give us medalcounts
load medalcounts bronzes silvers golds medals % Load them in.
% Now save them out.
save('medalcounts.mat', 'bronzes', 'silvers', 'golds', 'medals');
then attach it with the paperclip icon.
4 Kommentare
Image Analyst
am 13 Mär. 2022
I guess you would have to dl
load medalcounts bronzes silvers golds medals % Load them in.
% Now save them out to a file in the local C drive root folder.
save('c:\medalcounts.mat', 'bronzes', 'silvers', 'golds', 'medals');
Anyway, glad it's working.
Steven Lord
am 14 Mär. 2022
The first sentence of the task states "Make the code in the Task 1 section into a local function called paretoperc, where medals is the input and pp is the output." Originally you had created a local function paretoperc and had it accept an input named medals, but your function call did not assign its output to a variable named pp. In your most recent attempt you added the missing output argument.
Siehe auch
Kategorien
Mehr zu Introduction to Installation and Licensing finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!