File Issues after copying from another PC

I copied over a set of files from my workstation to use on my laptop when working in the labratory. The script runs fine when using the workstation but comes up with an error when used on my laptop. I didn't write this code a former student at my university did but I need to alter his plots using the file. I'm new to MATLAB, and added the Raw Tension Data to the file path, and tried restarting the program/computer. I can't seem to figure this out on my own. I've used other files the former student created with minimal issues on my laptop, this one is hanging me up.
Incorrect number or types of inputs or outputs for function resample.
Error in TensionPlots (line 7)
TPS_1 = resample(readmatrix('Raw Tension Data\PS-1.csv', 'NumHeaderLines',1),10,100);

 채택된 답변

Star Strider
Star Strider 2024년 6월 17일
편집: Steven Lord 2024년 6월 17일

1 개 추천

The resample function is part of the Signal Processing Toolbox. You need to have the Toolbox licensed and installed before you can use the function.
That particular call to it resamples the entire file at 10/100 times the original sample rate, literally decimating it, and returns it to your workspace as the ‘TPS_1’ variable. It operates down the columns, resampling each column.
[SL: fixed typo in toolbox name]

댓글 수: 3

John
John 2024년 6월 17일
Star Strider, Thank you! This has solved my problem, next time I have similar issue I will remember to check what toolboxes the file neededs to run.
Star Strider
Star Strider 2024년 6월 17일
As always, my pleasure!
I’m not certain there’s an efficient way to do that. You might need to check with the author of the original code. In some instances, the code could throw the error ‘##### function is part of the #### Toolbox’, however if there is more than one function by that name, as here, you will likely get a different (and less-than-desirably-informative) error.
.
Star Strider
Star Strider 2024년 6월 17일
@Steven Lord — Thank you (belatedly). I do my best to proofread what I post. I don’t always catch all my typos.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Install Products에 대해 자세히 알아보기

제품

릴리스

R2023b

질문:

2024년 6월 17일

댓글:

2024년 6월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by