Migrating 2015b code to 2018b
조회 수: 3(최근 30일)
표시 이전 댓글
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
댓글 수: 0
채택된 답변
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);
추가 답변(1개)
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')
참고 항목
범주
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!