Matlab Grader and resample()
7 次查看(过去 30 天)
显示 更早的评论
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);
0 个评论
回答(1 个)
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Multirate Signal Processing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!