Question
When I use the resample function, I get a dimension error. Here is the example used in the MATLAB help file, with the output: fs1 = 10; % Original sampling frequency in Hz t1 = 0:1/fs1:1; % Time vector x = t1; % Define a linear sequence y = resample(x,3,2); % Now resample it Error using + Matrix dimensions must agree. Error in firls (line 161) b = b + (F(s+1)*(m*F(s+1)+b1)*sinc(2*k*F(s+1)) ... Error in resample (line 85) h = p*firls( L-1, [0 2*fc 2*fc 1], [1 1 0 0]).*kaiser(L,bta)' ;
Expert Answer
John Williams
PhD Expert
Answered Aug 23, 2026
I'm not sure if you have a non-MathWorks' (modified) version of firls(), but the code you entered above should work:
fs1 = 10; t1 = 0:1/fs1:1; % Time vector x = t1; % Define a linear sequence y = resample(x,3,2); % Now resample it
Can you clear you workspace and copy and paste the above?
If you enter
>>which firls
Do you get something back like:
matlab\toolbox\signal\signal\firls.m
Also, which version of MATLAB are you using?
100% Run Guarantee
3-Hour Fast-Track Delivery
Need a Custom Version or Complete Simulation for This Problem?
Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.
Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here
Related matlab Questions & Solutions
Browse All →
Explore similar technical troubleshooting questions and verified MATLAB solutions:
Ready-to-Run MATLAB & Simulink Projects
Browse All Projects →