필터 지우기
필터 지우기

How to read a variable whose suffix changes randomly?

조회 수: 1 (최근 30일)
MT_jsmith
MT_jsmith 2018년 8월 24일
편집: Stephen23 2019년 3월 15일
Hi,everyone!
I have met a problem when ran a M program.
For example,running the program will product a variable as 'a_1'.And the number '1' is random.
Now,I want to get the value of 'a_number' and apply to myself M program.
How to do?
Thanks.
  댓글 수: 4
MT_jsmith
MT_jsmith 2018년 8월 24일
If I need to deal with different signals,using mdfimport will product many variables . Is there a better way?
Stephen23
Stephen23 2018년 8월 24일
편집: Stephen23 2019년 3월 15일
@MT_jsmith: if you are using this FEX submission, then no, there is no better way because unfortunately the author made some bad design decisions, and instead of simply returning a structure they make all of the variables magically appear in the workspace. Basically their bad design decision forces you to write bad code.
However there is a simple solution: download this much better designed tool:
which lets you simply load into an output variable (a cell array):
data = importMDF3(...)
Note that the MATLAB Vehicle Network toolbox also supports reading MDF files:

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

채택된 답변

madhan ravi
madhan ravi 2018년 8월 24일
편집: Matt J 2018년 8월 24일

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by