Matlab Grader and resample()

조회 수: 5 (최근 30일)
Greg Watkins
Greg Watkins 2021년 3월 1일
댓글: Greg Watkins 2021년 3월 1일
I am trying to use matlab grader with a script that uses the resample function.
The documentation online indicates some aspects of the signal processing toolbox are not available.... but resample() is not mentioned.
Any suggestions appreciated.
Thanks
The code below - copied from a mathworks website -
fs = 10;
t1 = 0:1/fs:1;
x = t1;
y = resample(x,3,2);
t2 = (0:(length(y)-1))*2/(3*fs);
plot(t1,x,'*',t2,y,'o')
xlabel('Time (s)')
ylabel('Signal')
legend('Original','Resampled', 'Location','NorthWest')
causes the following error.
Undefined function 'resample' for input arguments of type 'double'. Error in solution (line 4) y = resample(x,3,2);

답변 (1개)

Cris LaPierre
Cris LaPierre 2021년 3월 1일
편집: Cris LaPierre 2021년 3월 1일
I assume this is the website example you refer to? It works for me when I create and run the problem in a collection. Have you created your problem in a course?
In courses hosted on grader.mathworks.com, courses initially only have access to base MATLAB. In order to use any of the toolboxes, they must first be added to the course. See the Select Products for Courses page for instructions on how to do this. Once you add the Signal Processing toolbox, you should be able to run the code without an error.
As an aside, collections have access to all toolboxes. You can use a collection to create a repository of problems that you can then draw on it to build a course. You'll stil have to add the products to the course for students to solve the problems, but it can make the creation process a little easier. For more on this, see Ch 6.2 of Teaching with MATLAB.
  댓글 수: 1
Greg Watkins
Greg Watkins 2021년 3월 1일
Thanks Cris.
Rookie error. I missed that course option.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by