How would I implement the following programatically instead of using evalin?

matlI have a list of signals in a loop. The variables names of the signals are in signal list.
oldsize=evalin('base', ['length(' signallist{i} ')']);
assignin('base', signallist{i}, ...
evalin('base', [signallist{i} '(1:shortestsignalsize)'])); % shorten all signals

댓글 수: 5

Stephen23
Stephen23 2019년 12월 6일
편집: Stephen23 2019년 12월 6일
Is this code being called from inside a GUI?
Is is possible to simply pass the data as input/output arguments?
The most important question:
How did all of those separate variables get into the base workspace in the first place?
Using a script called MDF import.
MDFImport developed and avaible in the community so I do not want to modify it.
Thanks
Stephen23
Stephen23 2019년 12월 6일
편집: Stephen23 2019년 12월 7일
"MDFImport developed and avaible in the community so I do not want to modify it."
If you downloaded this very outdated, very badly designed tool:
then I strongly recommend you avoid it. An updated, much better version is available here:
It lets you import the data into one variable (see the help for importMDF3), thus you can trivially avoid the bad code that you will otherwise be forced to write accessing all of those numbered variables:
This is new than above and allows to interpolate all the data to a single axis.
"This is new than above and allows to interpolate all the data to a single axis."
It might be newer, but it is a badly designed (no output argument) and GUIDE-based....
Better to use importMDF3 from here:
or probably something from the vehicle network toolbox.

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

제품

태그

질문:

2019년 12월 6일

댓글:

2019년 12월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by