MATLAB Fundamentals course problem creating a local function
이전 댓글 표시
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
Image Analyst
2022년 3월 13일
편집: Image Analyst
2022년 3월 13일
OK, we'll help. What can we do (short of doing the whole course to get to chapter 15)?
Ajit Singh
2022년 3월 13일
SANJEEV PERUMAL R S
2023년 5월 25일
use this -
pp=paretoperc(medals)
답변 (3개)
Renee Coetsee
2022년 3월 15일
편집: Renee Coetsee
2022년 3월 15일
2 개 추천
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
Renee Coetsee
2022년 3월 17일
This issue should be fixed now. You should no longer need to add clear to pass the tests.
Chrysolite Dhinakaran
2022년 6월 6일
I'm still running into this issue for 8.1 Project - Halfway Review of Fundamentals (Women's 200m Backstroke). I'm using the exact same code as the solution and it's not working.
Renee Coetsee
2022년 6월 6일
Hi Chrysolite, I just tried completing the 8.1 Project using the solution code and I was able to pass all the tests. To help me reproduce this issue, please provide the following information:
- Which Task are you unable to complete?
- Which assessment is failing?
- What is the full URL of the activity? There is version information in the URL.
- Can you post a screenshot of the full live script and any errors you are getting in the script?
You can try copying the entire solution script into the active script, not just the code for that Task.
Chrysolite Dhinakaran
2022년 6월 6일
편집: Chrysolite Dhinakaran
2022년 6월 6일
I tried it again and it just worked! Thanks for your quick response though!
MANINDER CHOUDHARY
2023년 3월 18일
I'm facing the same problem. I have tried the different techniques but still the problem is unresloved.
Renee Coetsee
2023년 3월 20일
Hi Maninder, I'm not sure which activity is having a problem so I just tried 15.1 and 8.1. I wasn't able to reproduce any issues. Can you please provide the details in my previous comment?
- Which Task are you unable to complete?
- Which assessment is failing?
- What is the full URL of the activity? There is version information in the URL.
- Can you post a screenshot of the full live script and any errors you are getting in the script?
Sibusiso Mahlangu
2023년 4월 10일
Greetings. I am encountering the same issue for 15.1 and code is refusing to run. Please assist.
Sibusiso Mahlangu
2023년 4월 10일
The failing function is "Is pp calculated from the function paretoperc"?
Renee Coetsee
2023년 4월 10일
Hi Sibusiso, what is the full URL of the activity? There is version information in the URL that I need to investigate the issue.
Ibrahim
2023년 6월 14일
Hi. I'm running into the same issue.
here's the url MATLAB Fundamentals (mathworks.com)
Renee Coetsee
2023년 6월 14일
Hi Ibrahim, I am not seeing any problems at that link. I tested both tasks.
Can you post a screenshot of the full live script and any errors you are getting in the script?
Ibrahim
2023년 6월 15일
Hi Renee. Please find attached
Renee Coetsee
2023년 6월 15일
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
2022년 3월 13일
편집: Image Analyst
2022년 3월 13일
0 개 추천
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
Ajit Singh
2022년 3월 13일
Ajit Singh
2022년 3월 13일
Ajit Singh
2022년 3월 13일
편집: Ajit Singh
2022년 3월 13일
Image Analyst
2022년 3월 13일
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
Ajit Singh
2022년 3월 13일
Ajit Singh
2022년 3월 13일
Image Analyst
2022년 3월 13일
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
2022년 3월 14일
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.
카테고리
도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

