Migrating 2015b code to 2018b

2 ビュー (過去 30 日間)
Ajai Singh
Ajai Singh 2021 年 7 月 7 日
コメント済み: Ajai Singh 2021 年 7 月 7 日
Hi everyone ,
I have a .m file which makes use of functions that were available only in 2015b version of matlab and now i need to make the code working on 2018b ? Can someone help to do this?
Thank you

採用された回答

Cris LaPierre
Cris LaPierre 2021 年 7 月 7 日
編集済み: Cris LaPierre 2021 年 7 月 7 日
The analoginput function was removed in R2016a. See the release notes here (under Legacy Interface Removed).
Pre R2016a you might do this:
% Legacy code
ai = analoginput('nidaq','Dev1');
addchannel(ai,0);
start(ai);
data = getdata(ai);
Equivalent code starting in R2016a
s = daq.createSession('ni');
addAnalogInputChannel(s,'Dev1',1,'voltage')'
data = startForeground(s);
  9 件のコメント
Cris LaPierre
Cris LaPierre 2021 年 7 月 7 日
I'm not sure what it refers to. My searching suggests it is not a property of session-based interfaces. I can't find any references to it at least.
Ajai Singh
Ajai Singh 2021 年 7 月 7 日
Thank you so much for your help. I really appreciate it.

サインインしてコメントする。

その他の回答 (1 件)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021 年 7 月 7 日
In fact, in general all M-files (Simulink .slx and .mdl files) are forward compatible. However, there a few fcn/command syntaxes have been changed in later versions of matlab. E.g.:
legend('Abc', 'Dce', 1) % Old version
legend('Abc', 'Dce', 'location', 'northeast')
  1 件のコメント
Ajai Singh
Ajai Singh 2021 年 7 月 7 日
HWInfo = daqhwinfo(analoginput(handles.DeviceName,handles.DeviceID))
the above line has functions that were used in 2015b , can you help me to make it work on 2018b?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by